TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.

This is what i have in my file :
const fs = require("fs");
const mineflayer = require("mineflayer");
const Discord = require('discord.js');
const {pathfinder, Movements, goals} = require('mineflayer-pathfinder');
const settings = JSON.parse(fs.readFileSync("./settings.json", "utf-8"));

const client = new Discord.Client();
client.login(settings.discordtoken);
const fs = require("fs");
const mineflayer = require("mineflayer");
const Discord = require('discord.js');
const {pathfinder, Movements, goals} = require('mineflayer-pathfinder');
const settings = JSON.parse(fs.readFileSync("./settings.json", "utf-8"));

const client = new Discord.Client();
client.login(settings.discordtoken);
Error :
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^

TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:512:13)
at new Client (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:80:10)
at Object.<anonymous> (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\bot.js:7:16)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'ClientMissingIntents'
}
throw new DiscordjsTypeError(ErrorCodes.ClientMissingIntents);
^

TypeError [ClientMissingIntents]: Valid intents must be provided for the Client.
at Client._validateOptions (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:512:13)
at new Client (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\node_modules\discord.js\src\client\Client.js:80:10)
at Object.<anonymous> (C:\Users\gabri\OneDrive\Bureau\Projects\Oa bot\pigeonbot 1.0\bot.js:7:16)
at Module._compile (node:internal/modules/cjs/loader:1358:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1416:10)
at Module.load (node:internal/modules/cjs/loader:1208:32)
at Module._load (node:internal/modules/cjs/loader:1024:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:174:12)
at node:internal/main/run_main_module:28:49 {
code: 'ClientMissingIntents'
}
This happens when i run it
14 Replies
d.js toolkit
d.js toolkit7mo 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! - Marked as resolved by OP
treble/luna
treble/luna7mo ago
you need to provide intents for your client
Pigeon
PigeonOP7mo ago
[email protected] node v20.13.1
treble/luna
treble/luna7mo ago
cant just construct an empty client
Pigeon
PigeonOP7mo ago
what does that mean
d.js docs
d.js docs7mo ago
:guide: Popular Topics: Gateway Intents read more
Pigeon
PigeonOP7mo ago
I also have that
client.on('ready', () => {
console.log('Discord bot has logged in!');
});
client.on('ready', () => {
console.log('Discord bot has logged in!');
});
treble/luna
treble/luna7mo ago
you have to provide intents for that to work i dont know where you got that code from but it is outdated so consider following the guide instead
Pigeon
PigeonOP7mo ago
ok ty ill look into it error: new Error("Used disallowed intents") i now get this error
d.js docs
d.js docs7mo ago
- Error [DisallowedIntents]: Privileged intent provided is not enabled or whitelisted. - Error: Used disallowed intents If you are using the GuildMembers, GuildPresences, or MessageContent intents, you need to enable them via Developer Portal > Your app > Bot > Privileged Gateway Intents
treble/luna
treble/luna7mo ago
also what is your djs version
Pigeon
PigeonOP7mo ago
[email protected] i downloaded it today installed it
treble/luna
treble/luna7mo ago
alright i was wondering since you used the incorrect tag
Pigeon
PigeonOP7mo ago
@one hella gay wolvinny ❄ 🌈 alr done ty for your help
Want results from more Discord servers?
Add your server