#No that’s your parameter you need to

1 messages · Page 1 of 1 (latest)

obsidian palm
#

so this would be correct then: client.on('messagecreate', message => {

peak flare
#

no

#

read it again

#
  1. the event is called messageCreate
  2. you are missing the GuildMessages and MessageContent intent
obsidian palm
#

sorry I am very new to coding but I will look into it

weary zinc
#

Very new to reading too

obsidian palm
#

I made the changes

const { Client, Intents } = require('discord.js');
const client = new Client({
intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.DIRECT_MESSAGES]
});

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

client.on('messageCreate', message => {
if (message.content.toLowerCase() === 'hello') {
message.channel.send('Hello World!');
}
});

but I am getting the error: Cannot read properties of undefined (reading 'FLAGS')
Any suggestions?

peak flare
#

interesting that you switched from working code to non working code