pls help fix error

D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548
throw new TypeError('CLIENT_MISSING_INTENTS');
^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548:13)
at new Client (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:76:10)
at Object.<anonymous> (D:\mercury\discordBotv13test\event\voice.js:51:16)
at Module._compile (node:internal/modules/cjs/loader:1375:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1234:19)
at require (node:internal/modules/helpers:176:18)
at readCommands (D:\mercury\discordBotv13test\index.js:45:29) {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}

Node.js v21.5.0
D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548
throw new TypeError('CLIENT_MISSING_INTENTS');
^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
at Client._validateOptions (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:548:13)
at new Client (D:\mercury\discordBotv13test\node_modules\discord.js\src\client\Client.js:76:10)
at Object.<anonymous> (D:\mercury\discordBotv13test\event\voice.js:51:16)
at Module._compile (node:internal/modules/cjs/loader:1375:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1434:10)
at Module.load (node:internal/modules/cjs/loader:1206:32)
at Module._load (node:internal/modules/cjs/loader:1022:12)
at Module.require (node:internal/modules/cjs/loader:1234:19)
at require (node:internal/modules/helpers:176:18)
at readCommands (D:\mercury\discordBotv13test\index.js:45:29) {
[Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}

Node.js v21.5.0
11 Replies
d.js toolkit
d.js toolkit8mo ago
- What's your exact discord.js npm list discord.js and node node -v version? - Not a discord.js issue? Check out #other-js-ts. - Consider reading #how-to-get-help to improve your question! - Explain what exactly your issue is. - Post the full error stack trace, not just the top part! - Show your code! - Issue solved? Press the button!
Martoz
MartozOP8mo ago
const { Client, Intents, MessageEmbed} = require('discord.js');

const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_TYPING
],
});
const { Client, Intents, MessageEmbed} = require('discord.js');

const client = new Client({
intents: [
Intents.FLAGS.GUILDS,
Intents.FLAGS.GUILD_MESSAGES,
Intents.FLAGS.GUILD_VOICE_STATES,
Intents.FLAGS.GUILD_MEMBERS,
Intents.FLAGS.DIRECT_MESSAGES,
Intents.FLAGS.GUILD_PRESENCES,
Intents.FLAGS.GUILD_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_REACTIONS,
Intents.FLAGS.DIRECT_MESSAGE_TYPING
],
});
Svitkona
Svitkona8mo ago
what version of djs are you on?
Martoz
MartozOP8mo ago
13.17.1 how to fix it ? @Qjuh oh, sorry
Svitkona
Svitkona8mo ago
seems to work on my side...
Martoz
MartozOP8mo ago
?
Svitkona
Svitkona8mo ago
?
Martoz
MartozOP8mo ago
I mean, on your side? Do you have the same mistake?
Svitkona
Svitkona8mo ago
it works fine
Martoz
MartozOP8mo ago
it doesn't work for me ( it gives an error
Want results from more Discord servers?
Add your server