I'm trying to configure a discord bot and I'm in my final steps and I keep getting this error message.
Everything was going so smoothly and I was following steps and suddenly
/Users/mista/node_modules/discord.js/src/client/Client.js:544
throw new TypeError('CLIENT_MISSING_INTENTS');
^
TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (/Users/mista/node_modules/discord.js/src/client/Client.js:544:13)
at new Client (/Users/mista/node_modules/discord.js/src/client/Client.js:73:10)
at Object.<anonymous> (/Users/mista/Downloads/SMSBotBypass/bots/discord/bot.js:5:16)
at Module._compile (internal/modules/cjs/loader.js:1072:14)
at Object.Module._extensions..js (internal/modules/cjs/loader.js:1101:10)
at Module.load (internal/modules/cjs/loader.js:937:32)
at Function.Module._load (internal/modules/cjs/loader.js:778:12)
at Function.executeUserEntryPoint [as runMain] (internal/modules/run_main.js:76:12)
at internal/main/run_main_module.js:17:47 {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}
That's the bot I'm trying to configure https://github.com/Ross1337/SMSBotBypass
It's probably because you didn't put any Intents or put an invalid Intents on the Client. There is an official discord.js guide that is really helpful.
To add Intents to your client:
// Extracting Intents from DJS V13
const { Intents, Client } = require('discord.js');
const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
]
});
The Intents I put is just basic Intents for a bot. To see what intents you really need, and what intents give you, there is an intents calculator and there is also the official documentation of Discord Intents