Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

191
Vistas
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 Respuestas
Responde la pregunta

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 Denunciar

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 Denunciar
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda