aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2020-10-01 09:06:05 -0700
committerGravatar MarkKoz <[email protected]>2020-10-01 09:06:05 -0700
commitaaeedc97fe7462093b06536f1f4aa7f1fa9c0919 (patch)
tree1e67f00446b6dd814cca102f62b7c713d7f0de48
parentDuck pond: ignore reactions in DMs (diff)
Duck pond: ignore reaction events from other guilds
-rw-r--r--bot/exts/fun/duck_pond.py10
1 files changed, 8 insertions, 2 deletions
diff --git a/bot/exts/fun/duck_pond.py b/bot/exts/fun/duck_pond.py
index b146545a4..82084ea88 100644
--- a/bot/exts/fun/duck_pond.py
+++ b/bot/exts/fun/duck_pond.py
@@ -145,8 +145,8 @@ 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:
+ # Ignore other guilds and DMs.
+ if payload.guild_id != constants.Guild.id:
return
# Was this reaction issued in a blacklisted channel?
@@ -182,7 +182,13 @@ class DuckPond(Cog):
@Cog.listener()
async def on_raw_reaction_remove(self, payload: RawReactionActionEvent) -> None:
"""Ensure that people don't remove the green checkmark from duck ponded messages."""
+ # Ignore other guilds and DMs.
+ if payload.guild_id != constants.Guild.id:
+ return
+
channel = discord.utils.get(self.bot.get_all_channels(), id=payload.channel_id)
+ if channel is None:
+ return
# Prevent the green checkmark from being removed
if payload.emoji.name == "✅":