Compare commits
No commits in common. "472f67b3f60d572e081540d4b504a75298d97c4d" and "dabd0d9b18390fc8e3c0f7a77b7a865830361d7c" have entirely different histories.
472f67b3f6
...
dabd0d9b18
2 changed files with 3 additions and 26 deletions
|
@ -210,28 +210,15 @@ class MatcherCog(commands.Cog):
|
||||||
async def run_hourly_tasks(self):
|
async def run_hourly_tasks(self):
|
||||||
"""Run any hourly tasks we have"""
|
"""Run any hourly tasks we have"""
|
||||||
|
|
||||||
# Send a reminder for anything that will be active in 1 day
|
|
||||||
for (channel, _) in state.State.get_active_match_tasks(datetime.now() + timedelta(days=1)):
|
|
||||||
logger.info("Reminding about scheduled task in %s", channel)
|
|
||||||
msg_channel = self.bot.get_channel(int(channel))
|
|
||||||
await msg_channel.send(strings.reminder())
|
|
||||||
|
|
||||||
# Match groups for anything active right now
|
|
||||||
for (channel, min) in state.State.get_active_match_tasks():
|
for (channel, min) in state.State.get_active_match_tasks():
|
||||||
logger.info("Scheduled match task triggered in %s", channel)
|
logger.info("Scheduled match task triggered in %s", channel)
|
||||||
msg_channel = self.bot.get_channel(int(channel))
|
msg_channel = self.bot.get_channel(int(channel))
|
||||||
await match_groups_in_channel(msg_channel, min)
|
await match_groups_in_channel(msg_channel, min)
|
||||||
|
|
||||||
# Send a reminder to threads for a match that happened two days ago
|
for (channel, _) in state.State.get_active_match_tasks(datetime.now() + timedelta(days=1)):
|
||||||
for (channel, _) in state.State.get_active_match_tasks(datetime.now() - timedelta(days=2)):
|
logger.info("Reminding about scheduled task in %s", channel)
|
||||||
logger.info("Sending reminders to threads in %s", channel)
|
|
||||||
msg_channel = self.bot.get_channel(int(channel))
|
msg_channel = self.bot.get_channel(int(channel))
|
||||||
# Find any threads that need
|
await msg_channel.send(strings.reminder())
|
||||||
for thread in msg_channel.threads:
|
|
||||||
# Only regard threads the bot created
|
|
||||||
# And that have no additional messages
|
|
||||||
if thread.owner.id == self.bot.user.id and thread.message_count <= 1:
|
|
||||||
await thread.send(strings.thread_reminder())
|
|
||||||
|
|
||||||
|
|
||||||
# Increment when adjusting the custom_id so we don't confuse old users
|
# Increment when adjusting the custom_id so we don't confuse old users
|
||||||
|
|
|
@ -145,16 +145,6 @@ Make sure you're /pause'd if you need to be, or /join in ASAP!""",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
|
||||||
@randomised
|
|
||||||
def thread_reminder(): return [
|
|
||||||
"Hey friends, just checking in! No worries if you're too busy this week",
|
|
||||||
"Bork bork, quick reminder in case y'all forgot!",
|
|
||||||
"Hey matchees, how's your week going?",
|
|
||||||
"Hey everyone, don't forget to check in with eachother!",
|
|
||||||
"Quick friendly nudge, how're you all doing?",
|
|
||||||
]
|
|
||||||
|
|
||||||
|
|
||||||
@randomised
|
@randomised
|
||||||
def matching(): return [
|
def matching(): return [
|
||||||
"Matchy is matching matchees...",
|
"Matchy is matching matchees...",
|
||||||
|
|
Loading…
Add table
Reference in a new issue