aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-09-30 17:06:59 -0700
committerGravatar MarkKoz <[email protected]>2020-09-30 17:09:20 -0700
commit9322e89ba7d043f5525eca31c0dd785260788b44 (patch)
tree331489848bc130d66c46587347429ba6eac26358
parentPR #1191 Verification: broaden 50_007 error handling (diff)
Duck pond: ignore reactions in DMs
Also handle the channel not being found, which may be due to a cache issue or because it got deleted. Fixes #1183 Fixes BOT-8T
-rw-r--r--bot/exts/fun/duck_pond.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bot/exts/fun/duck_pond.py b/bot/exts/fun/duck_pond.py
index 6c2d22b9c..b146545a4 100644
--- a/bot/exts/fun/duck_pond.py
+++ b/bot/exts/fun/duck_pond.py
@@ -145,6 +145,10 @@ class DuckPond(Cog):
amount of ducks specified in the config under duck_pond/threshold, it will
send the message off to the duck pond.
"""
+ # Ignore DMs.
+ if payload.guild_id is None:
+ return
+
# Was this reaction issued in a blacklisted channel?
if payload.channel_id in constants.DuckPond.channel_blacklist:
return
@@ -154,6 +158,9 @@ class DuckPond(Cog):
return
channel = discord.utils.get(self.bot.get_all_channels(), id=payload.channel_id)
+ if channel is None:
+ return
+
message = await channel.fetch_message(payload.message_id)
member = discord.utils.get(message.guild.members, id=payload.user_id)