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

164
Vistas
How to use "client" in my commands? (Discord.js v13)
TypeError: Cannot read properties of null (reading 'tag')

This error comes whenever I try to use client in a command like this: client.user.tag
my message.js includes:

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

and

command.execute(client, message, args, MessageEmbed);

and my command file also contains: execute(client, message, args, MessageEmbed)

then also i am getting this error: TypeError: Cannot read properties of null (reading 'tag')
a help will be really appreciated...

UPDATE:
Ok i just console logged the client and got this:

user: null,
application: null,

now why is the client user = null?

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

0

This looks like a caching issue make sure that you have not disabled user caching since this will include the client user.

about 4 years ago · Juan Pablo Isaza Denunciar

0

client is a variable that holds the Discord bot client. You should read the docs to learn more about how it can be used.

It seems you are trying to get the client tag. If you read the docs, you will see that the client object has a property called user, which holds the user object. Since user objects hold the tag property, you're done.

client.user.tag
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