fix: emit ReactionCollector#remove when reaction is removed by collected user (#2803)

This commit is contained in:
Adam Gauthier
2018-08-31 23:02:30 -04:00
committed by Crawl
parent 314161ab70
commit 038b142db2

View File

@@ -105,7 +105,8 @@ class ReactionCollector extends Collector {
* @param {MessageReaction} reaction The reaction that was removed
* @param {User} user The user that removed the reaction
*/
if (this.collected.has(ReactionCollector.key(reaction))) {
if (this.collected.has(ReactionCollector.key(reaction)) &&
this.users.has(user.id)) {
this.emit('remove', reaction, user);
}
return reaction.count ? null : ReactionCollector.key(reaction);