aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Hassan Abouelela <[email protected]>2021-10-30 10:25:06 +0400
committerGravatar GitHub <[email protected]>2021-10-30 10:25:06 +0400
commitba4b0e498191195d773c031fcfdaef862bd472b8 (patch)
tree3fae5efbaa824aa957a39699075633f3cb2aa02c
parentMigrate to `og_blurple` (#924) (diff)
parentCandy Game: Ignore reactions to bot messages when adding candies (diff)
Merge pull request #931 from hedyhli/candy
Candy Game: Ignore reactions to bot messages when adding candies
-rw-r--r--bot/exts/holidays/halloween/candy_collection.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/bot/exts/holidays/halloween/candy_collection.py b/bot/exts/holidays/halloween/candy_collection.py
index 079d900d..bb9c93be 100644
--- a/bot/exts/holidays/halloween/candy_collection.py
+++ b/bot/exts/holidays/halloween/candy_collection.py
@@ -83,6 +83,11 @@ class CandyCollection(commands.Cog):
# if its not a candy or skull, and it is one of 10 most recent messages,
# proceed to add a skull/candy with higher chance
if str(reaction.emoji) not in (EMOJIS["SKULL"], EMOJIS["CANDY"]):
+ # Ensure the reaction is not for a bot's message so users can't spam
+ # reaction buttons like in .help to get candies.
+ if message.author.bot:
+ return
+
recent_message_ids = map(
lambda m: m.id,
await self.hacktober_channel.history(limit=10).flatten()