my code is fine and everything is fine but i get an error.
My code:
const { Client, Intents } = require('discord.js');
const client = new Client({ intents: [Intents.FLAGS.GUILDS] });
client.once('ready', () => {
console.log('Ready!');
client.user.setPresence({ activities: [{ name: 'Discord' }], status: 'idle' });
});
client.login(process.env.token);
The error:
TypeError: Cannot read properties of undefined (reading 'FLAGS')
at Object.<anonymous> (/home/runner/discordjs-bot/index.js:5:47)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
Any help?