Add a thread message with suggestions #18

Merged
mdiluz merged 2 commits from suggest-in-threads into main 2024-09-24 12:22:34 +01:00
2 changed files with 34 additions and 1 deletions

View file

@ -272,11 +272,14 @@ async def match_groups_in_channel(channel: discord.channel, min: int):
strings.matched_up([m.mention for m in group])) strings.matched_up([m.mention for m in group]))
# Set up a thread for this match if the bot has permissions to do so # 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: 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]), name=strings.thread_title([m.display_name for m in group]),
message=message, message=message,
reason="Creating a matching thread") 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 # Close off with a message
await channel.send(strings.matching_done()) await channel.send(strings.matching_done())
# Save the groups to the history # Save the groups to the history

View file

@ -174,6 +174,36 @@ 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?",
"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!",
]
@randomised @randomised
def thread_title(ms): return [ def thread_title(ms): return [
f"{format_list(ms)}", f"{format_list(ms)}",