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

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

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 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!