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

124
Vistas
Discord Bot outputting nothing client.on('ready')

Basically, when I run node . in my command prompt nothing is outputted.

My code:

const Discord = require("discord.js");

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

client.on("ready", () => {
    console.log(`Logged in as ${client.user.tag}`);
});
//My key is located here but I've taken it out for obvious reasons
client.login = "key";
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

client.login = ('key');

If that is how your code looks and isn't just a typo in the question, that is invalid syntax. client.login() is a method. This is how it should look:

client.login('key');

That is most likely your issue.

about 4 years ago · Juan Pablo Isaza Denunciar

0


Hello there Justin 👋

Your following code contains false syntax.

client.login = "key" //Will create errors.
client.login("key") //Will not create errors.

Also, I would recommend you to install dotenv from the npm package database. Its safer and barely needs any coding experience.

Just look at the difference

client.login("key") //Can see your token
require('dotenv').config();
client.login(process.env.key) //Cant see your token unless i see your .env

Just simply install the package running npm i dotenv, then create a file .env and inside that file have your enviromental variables.

key = token

I hope this helped you. Oh also if your bot is on GitHub make sure to add a .gitignore file so it cant be accessed by other users.

//.gitignore file

.env //This is the file you want hidden

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