Make sure you enable the message content intent on your developer portal and add the GatewayIntentBits.MessageContent
enum to your intents
array.
Applications ↦ Settings ↦ Bot ↦ Privileged Gateway Intents
You’ll also need to add the MessageContent
intent:
const client = new Client({
intents: [
GatewayIntentBits.DirectMessages,
GatewayIntentBits.Guilds,
GatewayIntentBits.GuildBans,
GatewayIntentBits.GuildMessages,
GatewayIntentBits.MessageContent,
],
partials: [Partials.Channel],
});