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

188
Views
No puedo enviar un mensaje a un usuario específico en discord.js

Estoy tratando de crear un sistema que envíe un mensaje al usuario cuando se llama a un comando. Pero cada vez que lo intento, dice TypeError: Cannot read property 'send' of undefined.

Aquí está el código que estoy usando.

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

Estoy usando Discord versión 12.

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

0

Significa que el usuario no está en caché, antes de que necesite buscar al usuario con el método <Client>.users.fetch .

Ejemplo para tu caso:

 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() para obtener directamente desde la 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!