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.
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.)

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With