Add a reminder for innactive threads #19

Merged
mdiluz merged 2 commits from add-reminder into main 2024-09-24 11:16:59 +01:00
2 changed files with 17 additions and 2 deletions
Showing only changes of commit f7898892e6 - Show all commits

View file

@ -223,10 +223,15 @@ class MatcherCog(commands.Cog):
await match_groups_in_channel(msg_channel, min)
# Send a reminder to threads for a match that happened two days ago
for (channel, min) in state.State.get_active_match_tasks(datetime.now() - timedelta(days=2)):
for (channel, _) in state.State.get_active_match_tasks(datetime.now() - timedelta(days=2)):
logger.info("Sending reminders to threads in %s", channel)
msg_channel = self.bot.get_channel(int(channel))
# TODO: Send a reminder per thread
# Find any threads that need
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

View file

@ -145,6 +145,16 @@ 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
def matching(): return [
"Matchy is matching matchees...",