I'm making my first Discord bot and I'm following this tutorial playlist here:
But for some reason my bot will load, say the load message, and even set its custom status but none of the commands are working. I have looked at many other forum posts and none are my problem so I'm very confused. I'm using Discord.js 14.3.0 and Node.js 16.17.0 on my Windows 10 machine. Here is my code:
const { Client, Discord, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
],
});
const token = ("REDACTED");
const prefix = '!';
client.once('ready', () => {
console.log('Bot is online!')
client.user.setActivity('Among Us');
});
client.on('message', message => {
if (message.content === prefix + 'ping') {
message.channel.send('Loading data').then(async(msg) => {
msg.delete()
message.channel.send(`Latency is ${msg.createdTimestamp - message.createdTimestamp}ms. API Latency is ${Math.round(client.ws.ping)}ms`);
})
}
});
client.login(token);
Also I have modified a few things and tried some other peoples code and I get no errors, it just won't work