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

94
Vistas
How to get ID of every role and member mentioned

So I'm making a discord bot using discord.js v13, and there is a command where I would like the user to be able to mention multiple members in 1 message or use their ID. But I'm having some trouble with this. I've tried:

   let UserID = message.mentions
   console.log(UserID)

But this didn't log only the user IDs, it also console logged some other information. If you know how to get only the user IDs please let me know.

Thanks.

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

0

To get users you mentioned IDs, you need to use message.mentions.users.map and get such code as result:

let userIDs = message.mentions.users.map(m => m.id).join("\n")
console.log(userIDs)

P.S. If you also need users' nicknames use .map(m => m.username + " " + m.id)

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