Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

314
Visualizações
Discord.js v13 Is there a way to create reaction roles with emojis?

Im trying to create command that will and an embed that then reacts with an emoji. If someone clicks the emoji it adds a role, if they remove their reaction, then the role gets removed. I know how to create the embed and react with the emoji, I just need the code that could work.

I've tried:

const filter = (reaction, user) => {
           return reaction.emoji.name === '✅' && user.id === message.author.id;
       };
       
       const collector = confirmation.createReactionCollector({filter});
       
       collector.on('collect', async(reaction, user) => {
           const role = await message.guild.roles.fetch("916861450281156678");
           
           message.guild.members.fetch(user.id).then(member => {
               member.roles.add(role);
               member.roles.remove("916929706182459392");
           });
       });

yet, the reactionCollector returns with TypeError: Cannot read properties of undefined (reading 'createReactionCollector') so i'm not sure what the problem is. For reference here is the embed code.

const { MessageEmbed } = require('discord.js');

module.exports = {
    name: 'rules',
    description: 'Server Rules',
    permission: "ADMINISTRATOR",
    async execute(message) {
        const rulemebed = new MessageEmbed()
        .setColor('#ffc7fe')
        .setTitle('Server Rules')
        .setDescription('Please click the check mark ✅ to verfiy that you read the rules and gain access to other channels')
        .setFooter('Abusing loop holes will result in fair punishment ')
        .addFields(
            {name: '#1', value:'...',},
        );
        

        const confirmation = await message.channel.send({ embeds: [rulemebed] }).then((sentMessage) => {
            sentMessage.react("✅");
        });

what i based the collector off

about 4 years ago · Juan Pablo Isaza
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda