Company logo
  • Empleos
  • Bootcamp
  • Acerca de nosotros
  • Para profesionales
    • Inicio
    • Empleos
    • Cursos y retos
    • Preguntas
    • Profesores
    • Bootcamp
  • Para empresas
    • Inicio
    • Nuestro proceso
    • Planes
    • Pruebas
    • Nómina
    • Blog
    • Calculadora

0

111
Vistas
[Symbol(code)]: 'CLIENT_MISSING_INTENTS' (Discord.js)

This is my code:

    import { Client } from 'discord.js';
    
    const bot = new Client();
    
    bot.on('ready', () => console.log('${bot.user.username} is online'));
    
    bot.login('MyToken');

This is the error i get. I have node 14.17.5 installed.

TypeError [CLIENT_MISSING_INTENTS]: Valid intents must be provided for the Client.
    at Client._validateOptions (C:\Users\jayrc\OneDrive\Documents\Coding\Discord\illuminate\node_modules\discord.js\src\client\Client.js:544:13)
    at new Client (C:\Users\jayrc\OneDrive\Documents\Coding\Discord\illuminate\node_modules\discord.js\src\client\Client.js:73:10)
    at file:///C:/Users/jayrc/OneDrive/Documents/Coding/Discord/illuminate/src/bot.js:3:13
    at ModuleJob.run (internal/modules/esm/module_job.js:170:25)
    at async Loader.import (internal/modules/esm/loader.js:178:24)
    at async Object.loadESM (internal/process/esm_loader.js:68:5) {
  [Symbol(code)]: 'CLIENT_MISSING_INTENTS'
8 months ago · Santiago Trujillo
1 Respuestas
Responde la pregunta

0

Assuming you're using the most recent version (v13) of discord.js, they specify on this page that you need node v16.6 or newer.

More specifically, v13 of discord.js introduced many changes to their client object, one of which was the introduction of intents.

Your bot needs to specify what its intents are within the constructor of the client object, like the getting started example on line 3.

const client = new Client({ intents: [Intents.FLAGS.GUILDS] });

Obviously which intents you need will depend on what your bot does. You can read up on intents on discord's official developer docs.

8 months ago · Santiago Trujillo Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar empleo Planes Nuestro proceso Comercial
Legal
Términos y condiciones Política de privacidad
© 2023 PeakU Inc. All Rights Reserved.