1
0
Fork 0

Fix on reaction, now check if voice message is not none

This commit is contained in:
Ethanell 2020-04-10 20:08:40 +02:00
parent 2862446c04
commit 60d1b02f94

View file

@ -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: