Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

354
Vistas
Discord Api Valid intents must be provided for the Client but the code dosent work

I set up the

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

for my discord.js bot.

But now I just get the error message:

Uncaught c:\Users\niko\Documents\bot\receptionist\index.js:8

The line 8 in my index.js is this:

const client = new Client({ intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES] });
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

const { Client, Intents, MessageEmbed, Presence, Collection, Interaction } = require ('discord.js');

const client = new Client({
    intents: [Intents.FLAGS.GUILDS, Intents.FLAGS.GUILD_MESSAGES]
});
about 4 years ago · Juan Pablo Isaza Denunciar

0

remove the first line of the code which states:

  
 const Discord = require('discord.js')

and also delete the third line of the code which follows :

const client= new Discord.Client()

because you're declaring the client with the intents below after declaring the prefix. And also delete

const bot = client
about 4 years ago · Juan Pablo Isaza Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda