Estoy tratando de crear un creador de equipos personalizado para mi canal de Discord. Cuando un usuario reacciona a un emoji específico, se colocará en el equipo especificado. El problema que tengo es que no sé cómo obtener la identificación del usuario para poder almacenar su identificación de usuario/nombre de usuario en la matriz del equipo para que se muestre. He intentado revisar la documentación, pero creo que no entiendo completamente la sintaxis. Aquí hay un fragmento de mi código.
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]); }