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

193
Views
Cannot read properties of undefined (reading 'users') | interaction.client.api.users | Discord.js V14

This Error: Console Error

TypeError: Cannot read properties of undefined (reading 'users')
    at Object.execute (D:\Mortal\Belgeler\Kod Denemeleri\Discord Botu\Via\v4 (v14)\commands\Kullanıcı\profil.js:34:55)
    at module.exports (D:\Mortal\Belgeler\Kod Denemeleri\Discord Botu\Via\v4 (v14)\events\interactionCreate.js:28:21)
    at processTicksAndRejections (node:internal/process/task_queues:96:5)

And this my code: Error

const APIFetch = await interaction.client.api.users(user ? user.id : interaction.user.id).get()

I could not find the solution to the problem on the internet because it is a new version. I researched for about 2 hours; At first, I looked at the sites and then looked at what data I could pull through interaction or the client. We can't pull API data. That's why we get the error "users" can't be read. At least that's it, as I understand it... How do I resolve this error?

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Use interaction.client.users directly:

const data = await interaction.client.users.fetch(user ? user.id : interaction.user.id);
about 4 years ago · Santiago Trujillo 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!