peoples my bot, dont work. Event 'messageCreated' the bot return nothing

const { token } = require('./token.json'); const Discord = require('discord.js'); const client = new Discord.Client({ intents: [ Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers, Discord.GatewayIntentBits.MessageContent, ], partials: [ Discord.Partials.Message, Discord.Partials.Channel, Discord.Partials.GuildMember, Discord.Partials.User, Discord.Partials.GuildScheduledEvent, ], }); client.on('ready', () => { console.log('This bot is now online', client.user.tag) client.user.setActivity('Rodando como bot mais lindo do Brasil') }); client.on('messageCreate', (message) => { console.log('oi') }) client.login(token);
2 Replies
d.js toolkit
d.js toolkit10mo 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!
d.js docs
d.js docs10mo ago
If you aren't getting content, embeds or attachments of a message, make sure you have the MessageContent intent enabled in the Developer Portal and provide it to your client:
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});
const { Client, GatewayIntentBits } = require('discord.js');
const client = new Client({
intents: [GatewayIntentBits.Guilds, GatewayIntentBits.GuildMessages, GatewayIntentBits.MessageContent]
});