Discord Intents

Hi all, Easy one, but I've confused myself with the documentation. I currently have the following code line:
const client = new Discord.Client({intents: Object.values(Discord.Intents.FLAGS)})
const client = new Discord.Client({intents: Object.values(Discord.Intents.FLAGS)})
I need to update this to the v14 version, but I've tripped myself up on what I need instead. Can anyone help, either with the code, or guidance for where I need to look, please?
14 Replies
d.js docs
d.js docs3y ago
• What's your exact discord.js npm list discord.js and node node -v version? • Post the full error stack trace, not just the top part! • Show your code! • Explain what exactly your issue is. • Not a discord.js issue? Check out #useful-servers.
d.js docs
d.js docs3y ago
We highly recommend only specifying the intents you actually need. • Note, that 98303, 32767 or whatever other magic number you read represents "all intents", somewhere, gets outdated as soon as new intents are introduced. • The number will always represent the same set of intents, excluding new ones, there is no magic "all intents" bit.
≪ °✾° ≫ 𝓓𝓮𝓵𝓽𝓪_𝓑𝓻𝓪𝓿𝓸92 ≪ °✾° ≫
That's what I was reading, but I got confused over which intents I need to set and how
d.js docs
d.js docs3y ago
• Websocket intents limit events and decrease memory usage: learn more • See what intents you need here Tag suggestion for @delta_bravo92: • Websocket intents limit events and decrease memory usage: learn more • See what intents you need here
MrMythical
MrMythical3y ago
Thqnkqng
Idris
Idris3y ago
restart your app ._.
Idris
Idris3y ago
≪ °✾° ≫ 𝓓𝓮𝓵𝓽𝓪_𝓑𝓻𝓪𝓿𝓸92 ≪ °✾° ≫
So in short, if I do
const { Client, GatewayIntentBits, Partials } = require('discord.js');
const { Client, GatewayIntentBits, Partials } = require('discord.js');
Is this all I need to do?
chewie
chewie3y ago
no, you also need to pass the proper intents to the client option . and you dont need Partials
Idris
Idris3y ago
I think you just need to replace Discord.Intents.FLAGS by Discord.IntentsBitField.Flags
chewie
chewie3y ago
or just GatewayIntentBits or Integrations yam
≪ °✾° ≫ 𝓓𝓮𝓵𝓽𝓪_𝓑𝓻𝓪𝓿𝓸92 ≪ °✾° ≫
that seems to have fixed it; thank you! 😄 Thanks all for your support
Want results from more Discord servers?
Add your server