aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--discord/state.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/discord/state.py b/discord/state.py
index 6a75491e..d089a5ed 100644
--- a/discord/state.py
+++ b/discord/state.py
@@ -287,8 +287,11 @@ class ConnectionState:
emoji = self._get_reaction_emoji(**data['emoji'])
reaction = utils.get(message.reactions, emoji=emoji)
- # if reaction isn't in the list, we crash. This means discord
- # sent bad data, or we stored improperly
+ # Eventual consistency means we can get out of order or duplicate removes.
+ if not reaction:
+ log.warning("Unexpected reaction remove {}".format(data))
+ return
+
reaction.count -= 1
if data['user_id'] == self.user.id:
reaction.me = False