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

209
Vistas
Discord.js bot not logging in

I made a discord bot and i have no idea what's wrong with my code i mean look:

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

client.login('you thought haha')

I tried various tutorials but it's still not working

about 4 years ago · Juan Pablo Isaza
3 Respuestas
Responde la pregunta

0

It's looking like about the intents and there's simple mistake as i've seen. If you wan't to open all intents i recommend you this;

const client = new Discord.Client({
    intents: new Discord.Intents(32767)
});

If you wan't specific intents then you should make them like;

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

Also don't forget to open your intents from bot section on your developer panel!

More info here on docs.

about 4 years ago · Juan Pablo Isaza Denunciar

0

I'm assuming you have already installed Node.js and discord.js, and also have a bot setup.

If you check discord.js Guide, they provide you the following code to start your bot:

// Require the necessary discord.js classes
const { Client, Intents } = require('discord.js');
const { token } = require('./config.json');

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

// When the client is ready, run this code (only once)
client.once('ready', () => {
    console.log('Ready!');
});

// Login to Discord with your client's token
client.login(token);

Then, open your terminal and run node index.js (assuming that your file name is index.js) to start the process. If you see "Ready!" after a few seconds, you're good to go!

I strongly recommend for you to follow this guide, it helped me a lot with the first steps with the discord bot.

Also, make sure that you have the right scopes selected for your bot: Bot scopes

about 4 years ago · Juan Pablo Isaza Denunciar

0

I think the error is on the client declaration. You have to capıtalize the first letter of "intents". So the code becomes:

const Discord = require("discord.js");
const client = new Discord.Client({
    Intents: [
        "GUILDS",
        "GUILD_MESSAGES"
    ]
});
client.login("your token here");

And also please make sure that on your discord developers page you have your intents turned on.

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