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

224
Vistas
How do I send a DM to a user in discord.js v13

All I'm doing right now is trying to send a dm to myself to see if I can get this working. I've tried:

client.users.cache.get(id).send('hi')
But I'm getting "TypeError: Cannot read properties of undefined (reading 'send')." I suppose this has something to do with myself not being cached, but I'm unsure how to go about caching myself. Does anyone know how to properly do this?

about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

Please take look at this post, it could resolve your problem.

Basically what it seems to happen is that the get method isn’t consistent like fetch. So prefer to use the fetch method, it will look something like this:

const user = await client.users.cache.fetch(id)
user.send('hi')

if you’re not in a asynchronous scope you could use the "then" approach:

client.users.cache.fetch(id)
  .then((user) => user.send('hi'))
  .catch(e => console.log(e))
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