Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

207
Views
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 answers
Answer question

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 Report

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!