Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Discord.js Bot [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted Error

I'm having issues with Discord.js Bot on v13+. I'm getting [DISALLOWED_INTENTS] error. How can I fix this? Thanks.

(node:16060) UnhandledPromiseRejectionWarning: Error [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted. at WebSocketManager.createShards (C:\Users\schne\Desktop\Zeltux_v1.5.2\node_modules\discord.js\src\client\websocket\WebSocketManager.js:260:15)
[05:24:04] (node:16060) UnhandledPromiseRejectionWarning: Unhandled promise rejection. 
        
This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 1)
        
[05:24:04] (node:16060) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.
like image 485
Kingz Empire Avatar asked Dec 01 '25 08:12

Kingz Empire


1 Answers

As the error suggests, [DISALLOWED_INTENTS]: Privileged intent provided is not enabled or whitelisted, you're probably using an intent that hasn't been enabled.

Gateway Intents were introduced to the library in v12 and allow you to pick which events your bot will receive. Intents are groups of pre-defined events that the discord.js client will conditionally subscribe to. For example, omitting the DIRECT_MESSAGE_TYPING intent would prevent the discord.js client from receiving any typing events from direct messages.

You'll have to go to Discord Developer Portal, choose your application, go to the Bot section, and enable all the intents. (Or the ones you are using.)

2

like image 137
Jakye Avatar answered Dec 03 '25 23:12

Jakye