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

315
Vistas
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 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