From 8bd242f00b575aedfe3e53c75da48b1256af2fa2 Mon Sep 17 00:00:00 2001 From: khazhyk Date: Sat, 5 Nov 2016 21:40:54 -0700 Subject: [PATCH] Fix crash on reaction remove. Discord can sometimes send integer 0 as the emoji id instead of null to signify a non-custom emoji, which was causing a crash due to a 'is not None' check assuming the reaction was for an emoji with id 0. Probably a discord bug, but preferable to handle here rather than crash users. --- discord/state.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/discord/state.py b/discord/state.py index 3c6873132..9df36cf0e 100644 --- a/discord/state.py +++ b/discord/state.py @@ -688,7 +688,7 @@ class ConnectionState: def _get_reaction_emoji(self, **data): id = data['id'] - if id is None: + if not id: return data['name'] for server in self.servers: