Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

667
Views
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 answers
Answer question

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 Report

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 Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!