#Help with Error: Used disallowed intents

5 messages · Page 1 of 1 (latest)

fleet yacht
#

Hello, I am learning how to code with a youtube video and I am wondering why Im getting this error and how to fix it.

import { config } from 'dotenv';
import { Client, GatewayIntentBits, Routes } from 'discord.js';
import { REST } from '@discordjs/rest';

config()

const TOKEN = process.env.TOKEN;
const CLIENT_ID = process.env.CLIENT_ID;
const GUILD_ID = process.env.GUILD_ID;

const client = new Client({ 
    intents: [
        GatewayIntentBits.Guilds, 
        GatewayIntentBits.GuildMessages,
        GatewayIntentBits.MessageContent,
    ],
})

Error: Used disallowed intents

naive etherBOT
#
  • What's your exact discord.js npm list discord.js and node node -v version?
  • Not a discord.js issue? Check out #1081585952654360687.
  • 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
misty jayBOT
#
  • 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

versed crane
#

regarding that REST import, @discordjs/rest is included with discord.js do you don't need to have it imported separately. just import everything directly from discord.js

fleet yacht
#

oh okay!