Samar
Samar
DIAdiscord.js - Imagine an app
Created by Samar on 1/18/2024 in #djs-questions
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');
}
});
6 replies