I used to work on discord bots a while back. However, the message event that I used to handle commands isn't working any more, after an update to discordjs.
I've tried both client.on('message', () => {})
and client.on('interactionCreate', () => {})
. However, neither of them seem to fire. Could anybody help?
In discord.js v13 it is now called messageCreate
instead of message
:
client.on('messageCreate', () => {
// some code
});
Also, you need to enable all required Intents
manually, for example:
const { Client, Intents } = require('discord.js');
const client = new Client({
intents: [
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILDS
]
});
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With