How to make a reaction limit in discord.js?

Viewed 35

I am making a ticket aka a private text channel and the first 8 people to react with gets to be in the ticket. I already have code to give the reaction but not the first 8 people.

Reaction Code

let Playembed = new Discord.EmbedBuilder()
        .setColor(0x0099FF)
        .setTitle(`inventors passion. host: ${message.author}`)
        .setDescription(`${message.author} is hosting inventors passion. if you would like to play react with !`)

    channel.send({ embeds: [Playembed] });
    Playembed.react(Playemoji);

    client.on('messageReactionAdd', async (reaction, user) => {
        if (reaction.message.partial) await reaction.message.fetch();
        if (reaction.partial) await reaction.message.fetch();
        if (user.bot) return;
        if (!reaction.message.guild) return;
        if (reaction.message.channel.id == channel) {
           if (reaction.emoji.name === Playemoji) {
                await reaction.message.guild.members.cache.get(user.id).roles.add(Players);
           }
        } else {
            return;
        }
    });

How do I add those people in the game to a variable?

0 Answers
Related