Add delay to goal alert.

This commit is contained in:
2025-09-24 23:12:24 +10:00
parent a19bb8a8cb
commit 32b84625df

View File

@@ -1,3 +1,4 @@
import asyncio
import re import re
from collections import defaultdict from collections import defaultdict
from datetime import datetime, timedelta from datetime import datetime, timedelta
@@ -84,6 +85,9 @@ class SubathonComponent(cmds.Component):
for i, goal in enumerate(goals): for i, goal in enumerate(goals):
if not goal.notified and goal.required_score <= score: if not goal.notified and goal.required_score <= score:
# Goal completed, notify channel # Goal completed, notify channel
# TODO: Quick hack to avoid running into ratelimits
# Should probably wait on a central messaging slow-lock bucketed by channel instead
await asyncio.sleep(1)
await channel.send_message( await channel.send_message(
f"We have reached Goal #{i+1}: {goal.description} !! Thank you everyone for your support <3", f"We have reached Goal #{i+1}: {goal.description} !! Thank you everyone for your support <3",
sender=self.bot.bot_id, sender=self.bot.bot_id,