aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Leon Sandøy <[email protected]>2018-09-14 07:31:15 +0000
committerGravatar Leon Sandøy <[email protected]>2018-09-14 07:31:15 +0000
commit836482f7296db95fb70c300b5c63e0dffe946c60 (patch)
tree70ddf892f4200f6910521ae8bfbbee506d4010c4
parentUse correct emote in codeblock correction message (diff)
parentAdded Member and Reaction to imports and added them to "on_reaction_add" prop... (diff)
Merge branch 'hemlock/codeblock-embed-reaction-deletion' into 'master'
Added Member and Reaction to imports and added them to "on_reaction_add"… See merge request python-discord/projects/bot!62
-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