0
votes

I want to do is that when the embed message is changed, the reactions are reset, not deleted. I mean that when someone reacts to the emoji and embed its changed, the reaction returns to 1 and does not stay at 2. and when it returns to 1 I can send a third embed

enter image description here enter image description here

ty

This is the code I am using:

const embed = new MessageEmbed()
      .setTitle("Test1")
      .setFooter("Test1");
    message.channel.send(embed).then(sentEmbed => {
      sentEmbed.react("➡");
      const filter = (reaction, user) => {
        return (
          ["➡"].includes(reaction.emoji.name) &&
          user.id === message.author.id
        );
      };

      sentEmbed
        .awaitReactions(filter, { max: 1, time: 30000, errors: ["time"] })
        .then(collected => {
          const reaction = collected.first();

          if (reaction.emoji.name === "➡") {

            const embed2 = new MessageEmbed()
            .setTitle('test2')
            .setDescription('test2')
             sentEmbed.edit(embed2);
          }
        })
    });
1

1 Answers

0
votes

You can remove all reactions by using message.reactions.removeAll().catch(error => console.error('Failed to clear reactions: ', error)); and then add reactions back if you want. I would do this in a function so you don't have to add all the reactions over and over each time you want to update the embed.