From 367d12578ce29049ec33a05d1fde28e3eadadef2 Mon Sep 17 00:00:00 2001 From: Marc Di Luzio Date: Sun, 22 Sep 2024 15:14:19 +0100 Subject: [PATCH 1/2] Add a thread message with suggestions --- matchy/cogs/matcher.py | 5 ++++- matchy/cogs/strings.py | 27 +++++++++++++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/matchy/cogs/matcher.py b/matchy/cogs/matcher.py index aa911c4..f5ff5f1 100644 --- a/matchy/cogs/matcher.py +++ b/matchy/cogs/matcher.py @@ -272,11 +272,14 @@ async def match_groups_in_channel(channel: discord.channel, min: int): strings.matched_up([m.mention for m in group])) # Set up a thread for this match if the bot has permissions to do so if channel.permissions_for(channel.guild.me).create_public_threads: - await channel.create_thread( + thread = await channel.create_thread( name=strings.thread_title([m.display_name for m in group]), message=message, reason="Creating a matching thread") + # Send a message with a suggested time to the channel + await thread.send(f"{strings.thread_message()} {strings.time_suggestion()}") + # Close off with a message await channel.send(strings.matching_done()) # Save the groups to the history diff --git a/matchy/cogs/strings.py b/matchy/cogs/strings.py index a617194..042322a 100644 --- a/matchy/cogs/strings.py +++ b/matchy/cogs/strings.py @@ -174,6 +174,33 @@ def matched_up(ms): return [ ] +@randomised +def thread_message(): return [ + "Hey peeps :)", + "How is everyone?", + "Bork!", + "Hey kiddos :)", + "Ahoy!", + "Great to see y'all here.", + "Icebreaker! What's your favourite pokemon?", + "I'm hungry, would a lasagna count as a sandwich?", + "What's your favourite keyboard key?", + "I'm confused thinking... Is a train just a sideways elevator?", + "Humans are weird, why do you have moustaches above your eyes?" +] + + +@randomised +def time_suggestion(): return [ + "Can I suggest a quick call on Wednesday?", + "Remember to organise a chat if you're up for it!", + "How about throwing something in the calendar for Friday?", + "Would 10am on Thursday work for people?", + "How about a call this afternoon?", + "Would a chat the start of a weekday work?" +] + + @randomised def thread_title(ms): return [ f"{format_list(ms)}", From 10e3dd3b36579665f07846e708ab2f00cacfa0d0 Mon Sep 17 00:00:00 2001 From: mdiluz Date: Tue, 24 Sep 2024 11:31:37 +0100 Subject: [PATCH 2/2] Add more random suggestion options --- matchy/cogs/strings.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/matchy/cogs/strings.py b/matchy/cogs/strings.py index 042322a..80da0cb 100644 --- a/matchy/cogs/strings.py +++ b/matchy/cogs/strings.py @@ -197,7 +197,10 @@ def time_suggestion(): return [ "How about throwing something in the calendar for Friday?", "Would 10am on Thursday work for people?", "How about a call this afternoon?", - "Would a chat the start of a weekday work?" + "Would a chat the start of a weekday work?", + "How's about organising a quick call sometime this week?", + "When's everyone available for a short hangout?", + "It's best to pick a time to drop in a call or meet up, if everyone is up for it!", ]