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

251
Views
¿Hay alguna forma de obtener información del usuario haciendo ping a alguien en Discord.js?

Tengo un comando en mi archivo discord.js que permite a los usuarios votar por alguien usando el comando !vote @user. Cada vez que imprimo @user, obtengo <@!user_id> . ¿Hay alguna manera de convertir ese valor en algo manipulable para, por ejemplo, obtener el nombre de usuario de @users o silenciarlos en una llamada de voz como cuando se usa msg.user ?

 client.on('message', msg) { if (msg.content.startsWith('!')) { let command = msg.content.substring('!'.length); let ping = command.split(' '); if(command == 'vote') { // Convert <@!user_id> into a manipulatable user? let user_information = ping[1] } } }
about 4 years ago · Juan Pablo Isaza
1 answers
Answer question

0

Podrías usar message.mentions.users

Como esto:

 const mention = message.mentions.users.first();

O si quisiera el miembro, podría usar message.mentions.members.first() como:

 const mention = message.mentions.members.first();

Si no desea usar eso, puede usar la guía de discord.js sobre el análisis de menciones

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!