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

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

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

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