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

185
Views
I can't send a message to a specific user in discord.js

I'm trying to make a system that sends a user a message when a command is called. But whenever I try, it says TypeError: Cannot read property 'send' of undefined.

Here is the code I am using.

 client.users.cache.get("220683253789163520").send("Test")

I am using discord version 12.

about 4 years ago · Juan Pablo Isaza
2 answers
Answer question

0

It means the user is not cached, before you need to fetch the user with <Client>.users.fetch method.

Example for your case:

await client.users.fetch('220683253789163520');
client.users.cache.get('220683253789163520').send('Test');
about 4 years ago · Juan Pablo Isaza Report

0

Use Client.users.fetch() to get directly from the API

const user = await client.users.fetch("220683253789163520")
await user.send("Test")
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!