#Bot not listening to messages

9 messages · Page 1 of 1 (latest)

upper nexus
#

Hi Folks, trying to create my first Discord app. I have my bot logged in and I see it running. I've turned on Privileged Gateway Intents on the Developer Portal but my bot still won't listen to my Ping msgs.

Here is my code:

const { Client, GatewayIntentBits } = require('discord.js')

const client = new Client({
intents: [
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
GatewayIntentBits.GuildMembers,
]
});

client.on('ready', () => {
console.log(Logged in as ${client.user.tag}!);
});

client.on('message', (message) => {
console.log(message);

if (message.content === 'Ping') {
console.log('pls work');
message.reply('Pong!');
}
});

client.login('XXX');

fallow sphinx
#

• What's your exact discord.js npm list discord.js and node node -v version?
• Post the full error stack trace, not just the top part!
• Show your code!
• Explain what exactly your issue is.
• Not a discord.js issue? Check out #useful-servers.

frigid wing
#

The event name is messageCreate

upper nexus
finite seal
#

client.on("eventName", handler)

#

message isn't one of them

#

try reading the guide

upper nexus
#

Thanks, resources I was looking at must be dated.