Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

359
Visualizações
ReferenceError: Client Missing Intents Discord Bot

I've just started working on a discord bot, but whenever I try to start it using node . in the cmd prompt, I get this error;

C:\Users\kaute\OneDrive\Área de Trabalho\Projetos De Programação\NewBot\node_modules\discord.js\src\client\Client.js:548
      throw new TypeError('CLIENT_MISSING_INTENTS');
      ^

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
    at Client._validateOptions (C:\Users\kaute\OneDrive\Área de Trabalho\Projetos De Programação\NewBot\node_modules\discord.js\src\client\Client.js:548:13)
    at new Client (C:\Users\kaute\OneDrive\Área de Trabalho\Projetos De Programação\NewBot\node_modules\discord.js\src\client\Client.js:76:10)    
    at Object.<anonymous> (C:\Users\kaute\OneDrive\Área de Trabalho\Projetos De Programação\NewBot\src\main.js:2:13)
    at Module._compile (node:internal/modules/cjs/loader:1103:14)
    at Object.Module._extensions..js (node:internal/modules/cjs/loader:1157:10)
    at Module.load (node:internal/modules/cjs/loader:981:32)
    at Function.Module._load (node:internal/modules/cjs/loader:822:12)
    at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:77:12)
    at node:internal/main/run_main_module:17:47 {
  [Symbol(code)]: 'CLIENT_MISSING_INTENTS'
}
Waiting for the debugger to disconnect...

I've looked around and cant find anything specific enough to fix my issue. Here is my code;

const Discord = require('discord.js');
const bot = new Discord.Client();

const token = The Token;

bot.on('ready', () => {
   console.log('The bot is ready!')
});

As I said I just started today, so There isn't much here

about 4 years ago · Juan Pablo Isaza
1 Respostas
Responde à pergunta

0

Since discord.js v13, you need to provide intents when declaring the client. They were introduced so that developers could choose which events their bot needed to receive based on which data it needs to function. To add intents to your client, you can import Intents from discord.js and then add it to the client by using:

const { Intents, Client } = require('discord.js')
const client = new Client({
    intents: [
        Intents.FLAGS.GUILDS,
        Intents.FLAGS.GUILD_MESSAGES
    ]
})

To learn more about intents, you can go to => Gateway Intents

about 4 years ago · Juan Pablo Isaza Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda