Add a thread message with suggestions
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 33s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 1m8s

This commit is contained in:
Marc Di Luzio 2024-09-22 15:14:19 +01:00
parent dabd0d9b18
commit 367d12578c
2 changed files with 31 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]))
# 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

View file

@ -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)}",