This is my code:
require('dotenv').config();
const { Client, Intents } = require('discord.js');
const client = new Client({
intents: [
Intents.FLAGS.Guilds,
Intents.FLAGS.GuildMembers,
Intents.FLAGS.GuildMessages,
Intents.FLAGS.MessageContent,
],
});
client.on('ready', (c) => {
console.log(`✅ ${c.user.tag} is online.`);
});
client.on('messageCreate', (message) => {
if (message.author.bot) {
return;
}
if (message.content === 'hello') {
message.reply('hello');
}
});
I tried to make a simple test command but when i try to run it , it gives me that error.
I dont understand what i did wrong, i followed a tutorial. But it works perfectly fine with ‘node .’but with nodemon it has that error