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

367
Vistas
How to send a dm to another person discord.js? (javascript)

I'm making a discord bot and I wrote this code, but it gives an error, user.dm is not a function.

My code:

if(message.content.startsWith('s!modöner')) {
    let mesajöner = args.slice(1).join(' ');
    let userdm = 767387717792563241
    userdm.send(mesajöner);
    message.reply('Quixe Öneriniz Gönderildi.');
}
about 4 years ago · Juan Pablo Isaza
1 Respuestas
Responde la pregunta

0

I assume that the userdm variable is a user id, and you want to DM that user. In that case, you would first have to get the user from client.users.cache, then you can send it. An example:

const user = client.users.cache.get('767387717792563241')
user.send(mesajöner)

(Note: In discord, all ids are Strings, so any id you use should be used as a string instead of a number like you have)

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