From 60d1b02f94c21540cba92b928c785ec0e4ed4b71 Mon Sep 17 00:00:00 2001 From: flifloo Date: Fri, 10 Apr 2020 20:08:40 +0200 Subject: [PATCH] Fix on reaction, now check if voice message is not none --- extensions/speak.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/extensions/speak.py b/extensions/speak.py index 2afe386..7d82d2d 100644 --- a/extensions/speak.py +++ b/extensions/speak.py @@ -96,7 +96,7 @@ class Speak(commands.Cog): @commands.Cog.listener() async def on_reaction_add(self, reaction: Reaction, user: Member): if not user.bot: - if reaction.message.id == self.voice_message.id: + if self.voice_message and reaction.message.id == self.voice_message.id: if str(reaction.emoji) == "\U0001f5e3": await self.speak_action(reaction, user) elif str(reaction.emoji) == "\u2757": @@ -215,7 +215,7 @@ class Speak(commands.Cog): @commands.Cog.listener() async def on_reaction_remove(self, reaction: Reaction, user: Member): if not user.bot: - if reaction.message.id == self.voice_message.id: + if self.voice_message and reaction.message.id == self.voice_message.id: if str(reaction.emoji) == "\U0001f5e3" and user.id in self.waiting and user.id != self.last_speaker: self.waiting.remove(user.id) elif str(reaction.emoji) == "\u2757" and user.id in self.reaction and user.id != self.last_reaction: