Reputation: 89
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?
Upvotes: 4
Views: 5330
Reputation: 1880
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
]
});
Upvotes: 10