Discord API valid intents must be provided for the client [duplicate]

First of all, never show a token of your bot, or try to change it later.

Second of all:

Try using this. Since the new updated version of discord.js, like version ^13.0, you have to specify client intents:

const { Client, Intents } = require('discord.js');

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });

And obviously, put client.login(TOKEN) at the very bottom.

For more updates required from new version of discord.js, see What’s new.

Leave a Comment

tech