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

248
Vistas
Is there a way to get user information by pinging someone in Discord.js?

I have a command in my discord.js file that allows users to vote for someone using a !vote @user command. Whenever I print out @user, I get <@!user_id>. Is there a way to turn that value into something manipulatable to for example, get @users's username or mute them in a voice call like when using 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 Respuestas
Responde la pregunta

0

You could use message.mentions.users

Like this:

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

Or if you wanted the member you could use message.mentions.members.first() like:

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

If you don't want to use that you could use discord.js's guide on parsing mentions

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