aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Matteo Bertucci <[email protected]>2020-10-10 18:38:10 +0200
committerGravatar Matteo Bertucci <[email protected]>2020-10-10 18:38:10 +0200
commitf76bced0f77cd36a2ce25ff11717c2d277c3de60 (patch)
tree5388f7991f64f77541f65b3e98369b71191d1225
parentMerge pull request #1165 from RohanJnr/smart_syncing_users (diff)
Duckpond: Add a list of already ducked messages
Previously race conditions caused the messages to be processed again before knowing the white check mark reaction got added, this seems to solve it
-rw-r--r--bot/exts/fun/duck_pond.py4
1 files changed, 3 insertions, 1 deletions
diff --git a/bot/exts/fun/duck_pond.py b/bot/exts/fun/duck_pond.py
index 82084ea88..48aa2749c 100644
--- a/bot/exts/fun/duck_pond.py
+++ b/bot/exts/fun/duck_pond.py
@@ -22,6 +22,7 @@ class DuckPond(Cog):
self.bot = bot
self.webhook_id = constants.Webhooks.duck_pond
self.webhook = None
+ self.ducked_messages = []
self.bot.loop.create_task(self.fetch_webhook())
self.relay_lock = None
@@ -176,7 +177,8 @@ class DuckPond(Cog):
duck_count = await self.count_ducks(message)
# If we've got more than the required amount of ducks, send the message to the duck_pond.
- if duck_count >= constants.DuckPond.threshold:
+ if duck_count >= constants.DuckPond.threshold and message.id not in self.ducked_messages:
+ self.ducked_messages.append(message.id)
await self.locked_relay(message)
@Cog.listener()