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

675
Vistas
How do I mention a person using Discord.js with only the user id?

I'm trying to build a bot which mentions people on discord. I already have the usernames of people, and I've been trying to mention users with this :

function discordsend(usern)
{ 
string = "$add-money"+usern+"1";
const channel = client.channels.cache.get('channelid');
channel.send(string)
console.log(channel);
}

However, it just sends the message plainly to the channel without actually mentioning the user. Is there any way I could mention a user just using their user id ? (Username with Discriminator)

I've also heard I can mention users if I have their IDs, but I only have their User IDs. If there is a way to obtain IDs from UserIDs, please let me know !

FYI, UserID is in the form user#discriminator

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

0

Discord uses a special syntax to embed mentions in a message. For user mentions, it is the user's ID with <@ at the start and > at the end, like this:

<@12345678912345678>

If they have a nickname, there will also be a ! after the @.

about 4 years ago · Juan Pablo Isaza Denunciar

0

If I read your question correctly, you wanted to mention a member using their ID only, to use their ID you need to cache.get:

const member = message.guild.members.cache.get(args[0])

if you're familiar with args functions then you can use it too with channels and roles

If you wanted to ping them in bot's messages. you can use ${member} for example:

message.channel.send(`${member}`)
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