aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Brown <[email protected]>2018-09-13 17:33:43 -0500
committerGravatar Daniel Brown <[email protected]>2018-09-13 17:33:43 -0500
commit608c81f5e44c745a03e8f1d5c144a7df073c994e (patch)
tree70ddf892f4200f6910521ae8bfbbee506d4010c4
parentUse correct emote in codeblock correction message (diff)
Added Member and Reaction to imports and added them to "on_reaction_add" properties to convert them to the proper types.
Changed line 384 to compare ids for consistency Signed-off-by: Daniel Brown <[email protected]>
-rw-r--r--bot/cogs/bot.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/bot/cogs/bot.py b/bot/cogs/bot.py
index 9990d9e0a..9e73a97bb 100644
--- a/bot/cogs/bot.py
+++ b/bot/cogs/bot.py
@@ -3,7 +3,7 @@ import logging
import re
import time
-from discord import Embed, Message
+from discord import Embed, Member, Message, Reaction
from discord.ext.commands import Bot, Context, command, group
from dulwich.repo import Repo
@@ -368,7 +368,7 @@ class Bot:
bot_message = await after.channel.get_message(self.codeblock_message_ids[after.id])
await bot_message.delete()
- async def on_reaction_add(self, reaction, user):
+ async def on_reaction_add(self, reaction: Reaction, user: Member):
# Ignores reactions added by the bot or added to non-codeblock correction embed messages
if user.id == self.user.id or reaction.message.id not in self.codeblock_message_ids.values():
return
@@ -381,7 +381,7 @@ class Bot:
break
# If the reaction was clicked on by the author of the user message, deletes the bot message
- if user == user_message.author:
+ if user.id == user_message.author.id:
await bot_message.delete()
return