discord.js-pagination icon indicating copy to clipboard operation
discord.js-pagination copied to clipboard

FIX: If your bot unreacts to the embed

Open jameslinimk opened this issue 4 years ago • 1 comments

Go to index.js and remove line 13. (reaction.users.remove(msg.author);)

jameslinimk avatar Feb 02 '21 15:02 jameslinimk

Removing that line is NOT a fix. If you remove that line of code, if the user who sent a message/command to create the embed reacts it, their reaction won't be removed, therefore they will need to click multiple times to have the collect event fired for a second reaction.

The only case where that line of code is going to remove the BOTS reaction is if the message you're passing into paginationEmbed was created by the bot in the first place. This is incorrect / not the intended usage. The message you PASS into paginationEmbed should be the message sent by a member that initiated a command where your bot responded with the embed.

Either way, my PR fixes this issue by using the user parameter of the collect event instead. It also provides additional customizability.

psibean avatar Feb 03 '21 13:02 psibean