fix(MessageReaction): only delete reaction if cache and count is empty (#2661)

This commit is contained in:
Isabella
2018-07-23 16:32:51 -04:00
committed by GitHub
parent 717e7f094a
commit 3a7a7d730b

View File

@@ -71,7 +71,7 @@ class MessageReaction {
this.users.delete(user.id);
if (!this.me || user.id !== this.message.client.user.id) this.count--;
if (user.id === this.message.client.user.id) this.me = false;
if (this.count <= 0) {
if (this.count <= 0 && this.users.size === 0) {
this.message.reactions.remove(this.emoji.id || this.emoji.name);
}
}