DisallowedIntents if im run discord bot in terminal

Viewed 42
const { Client, GatewayIntentBits } = require("discord.js");

const client = new Client({
  intents: [
    GatewayIntentBits.Guilds, //all problem here
    GatewayIntentBits.GuildMessages,
    GatewayIntentBits.MessageContent,
    GatewayIntentBits.GuildMembers
  ],
});

client.login("TOKEN");
1 Answers

You get this problem because you are accessing privileged intents. To fix this go to https://discord.com/developers/applications/ click on your bot. Then go to the section that says bot and scroll down to Privileged Gateway Intents. Enable server members and message content intent. After that it should be fixed.

Related