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

239
Vistas
Discord bot Client not defined

I am trying to make a discord bot and I am running in to a problem:

ReferenceError: Client is not defined
at Object.<anonymous> (C:\Users\Arya\Desktop\Arya\Discord\bot.js:3:16)
at Module._compile (node:internal/modules/cjs/loader:1101:14)
at Object.Module._extensions..js (node:internal/modules/cjs/loader:1153:10)
at Module.load (node:internal/modules/cjs/loader:981:32)
at Function.Module._load (node:internal/modules/cjs/loader:822:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47

the code is

require("dotenv").config();
const { Cient, Intents } = require("discord.js");
const client = new Client({
intent: [
    Intents.FLAGS.GUILDS,
    Intents.FLAGS.GUILD_MESSAGES
 ]
});

bot.login(process.env.TOKEN);
about 4 years ago · Juan Pablo Isaza
2 Respuestas
Responde la pregunta

0

Simple syntax error, this works:

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

client.login(process.env.TOKEN);

Your login at the bottom confuses me where the bot variable is but if my code does not work you can change it back. Otherwise you just needed to add a s to intent.

about 4 years ago · Juan Pablo Isaza Denunciar

0

  • You are defining Cient instead of Client in the second line of your code
  • The client options must specify intents: [ YOUR_INTENTS_HERE ] instead of intent
  • The last line must be client.login instead of bot.login
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