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

166
Vistas
Grabbing user id/user name from reactions Discord.js V13

I'm trying to make a custom teambuilder for my Discord channel. When a user reacts to a specific emoji, they would get placed in the specified team. The problem m getting is, idk how to grab the user id so I can store their userid/username in the team array to be displayed. I've tried going through the documentation but I don't think I completely understand the syntax. Here's a snippit of my code.

const {Client, Intents, MessageEmbed, GuildMember} = require("discord.js")

const client = new Client({ intents:[Intents.FLAGS.GUILD_MESSAGES, Intents.FLAGS.GUILDS, 
Intents.FLAGS.GUILD_MESSAGE_REACTIONS] });
require('dotenv').config();

client.on("ready", () => {
  console.log("Bot is online")
})
client.on("messageCreate", async (message) => {

    if (message.author.bot) return;

    if (message.content.toLowerCase().startsWith('!formevent')) 
    {
        console.log ("A message got sent")
        let args = message.content.split(" ");
        let scrimSize = args[1];                

        if (scrimSize == 10){

            message.channel.send("Scrim size = "+ scrimSize)

            const redSide = ['Test data for red team'];
            const blueSide = ['Test data for blue team'];
            redSide.length = 5;
            blueSide.length = 5;

            const embed = new MessageEmbed()
                .setTitle ("Scrim")
                .setDescription ("React with 💙 to join blue team.\n React with ❤️ to 
join red team.")

            const embed2 = new MessageEmbed()
                .setTitle ("Blue Team (5 players)")
                .setDescription (blueSide[0])

            const embed3 = new MessageEmbed()
                .setTitle ("Red Team (5 players)")
                .setDescription (redSide[0])


                let msg = await message.channel.send({embeds: [embed, embed2, embed3]})

                await msg.react('💙');
                await msg.react('❤️');
                await msg.react('❌');
                await msg.react('✅');
            

                const filter =(reaction, user) =>  
                
            reaction.emoji.name === '💙' || reaction.emoji.name === '❤️' //&& user.id 
=== '213832006486720512'     
                msg.awaitReactions({ filter, time: 5000})
              
                    .then (collected => console.log( `Collected ${collected.size} 
reactions`))
                    
                        .catch(console.error);
                        //console.log (GuildMember.Id);             

        //console.log(redSide[0]);
    } 
about 4 years ago · Juan Pablo Isaza
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