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

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

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 Report

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