an issue with intents?

i dont understand what's wrong with this code because it should work
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent],
});

client.login('removed the token for security');

client.on('ready', () => {
console.log('Ecstasy is online');
});

client.on('messageCreate', (message) => {
if (message.content === 'hello') {
message.reply('hello');
}
});
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.GuildMessages, GatewayIntentBits.GuildMembers, GatewayIntentBits.MessageContent],
});

client.login('removed the token for security');

client.on('ready', () => {
console.log('Ecstasy is online');
});

client.on('messageCreate', (message) => {
if (message.content === 'hello') {
message.reply('hello');
}
});
4 Replies
d.js toolkit
d.js toolkit12mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button! - Marked as resolved by staff
Samar
SamarOP12mo ago
the node version is 18.18.0 which is compatible
treble/luna
treble/luna12mo ago
missing Guilds intent
Samar
SamarOP12mo ago
oh thanks
Want results from more Discord servers?
Add your server