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

208
Visualizações
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 Respostas
Responde à pergunta

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 Relatório

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 Relatório

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 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