Compare commits

...
Sign in to create a new pull request.

20 commits

Author SHA1 Message Date
647c0266e1 Merge pull request 'Update dependency pytest-asyncio to v0.25.2' (#27) from renovate/pytest-asyncio-0.x into main
All checks were successful
Test, Build and Publish / test (push) Successful in 34s
Test, Build and Publish / build-and-push-images (push) Successful in 46s
Reviewed-on: #27
2025-01-20 20:19:50 +00:00
c8bfa837aa Update dependency pytest-asyncio to v0.25.2
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 35s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 38s
2025-01-08 07:00:08 +00:00
20b0ba08cd Merge pull request 'Update dependency coverage to v7.6.10' (#23) from renovate/coverage-7.x into main
All checks were successful
Test, Build and Publish / test (push) Successful in 34s
Test, Build and Publish / build-and-push-images (push) Successful in 42s
Reviewed-on: #23
2025-01-05 23:15:35 +00:00
f07d52bf19 Merge pull request 'Update dependency pytest-asyncio to v0.25.1' (#26) from renovate/pytest-asyncio-0.x into main
Some checks failed
Test, Build and Publish / build-and-push-images (push) Blocked by required conditions
Test, Build and Publish / test (push) Has been cancelled
Reviewed-on: #26
2025-01-05 23:15:17 +00:00
84f18bceec Update dependency pytest-asyncio to v0.25.1
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 35s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 39s
2025-01-02 06:00:08 +00:00
e8f5350b8e Update dependency coverage to v7.6.10
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 35s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 41s
2024-12-26 17:00:08 +00:00
e0e927fead Merge pull request 'Update dependency coverage to v7.6.3' (#22) from renovate/coverage-7.x into main
All checks were successful
Test, Build and Publish / test (push) Successful in 39s
Test, Build and Publish / build-and-push-images (push) Successful in 1m36s
Reviewed-on: #22
2024-10-15 18:43:30 +01:00
fb4647c4e0 Update dependency coverage to v7.6.3
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 35s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 1m20s
2024-10-13 23:00:08 +00:00
66d3fe3e5c Merge pull request 'Update dependency coverage to v7.6.2' (#21) from renovate/coverage-7.x into main
All checks were successful
Test, Build and Publish / test (push) Successful in 35s
Test, Build and Publish / build-and-push-images (push) Successful in 1m19s
Reviewed-on: #21
2024-10-13 17:02:52 +01:00
77d533fbcb Update dependency coverage to v7.6.2
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 35s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 52s
2024-10-09 12:00:08 +00:00
86d0075e5d Merge pull request 'Add a thread message with suggestions' (#18) from suggest-in-threads into main
All checks were successful
Test, Build and Publish / test (push) Successful in 34s
Test, Build and Publish / build-and-push-images (push) Successful in 1m9s
Reviewed-on: #18
2024-09-24 12:22:33 +01:00
10e3dd3b36 Add more random suggestion options
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 34s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 1m8s
2024-09-24 11:31:37 +01:00
472f67b3f6 Merge pull request 'Add a reminder for innactive threads' (#19) from add-reminder into main
All checks were successful
Test, Build and Publish / test (push) Successful in 33s
Test, Build and Publish / build-and-push-images (push) Successful in 1m10s
Reviewed-on: #19
2024-09-24 11:16:58 +01:00
f7898892e6 Send a reminder to innactive threads
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 34s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 1m12s
This sends a reminder message to any thread with 1 or less messages

This picks up only active threads too
2024-09-22 16:30:49 +01:00
455f202364 Add placeholder code for getting previous runs 2024-09-22 15:47:28 +01:00
367d12578c 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
2024-09-22 15:14:19 +01:00
dabd0d9b18 Merge pull request 'Update the readme with the new cadence value' (#16) from mdiluz-patch-2 into main
All checks were successful
Test, Build and Publish / test (push) Successful in 34s
Test, Build and Publish / build-and-push-images (push) Successful in 1m19s
Reviewed-on: #16
2024-09-22 14:43:39 +01:00
3b813a63da Merge branch 'main' into mdiluz-patch-2
All checks were successful
Test, Build and Publish / test (pull_request) Successful in 34s
Test, Build and Publish / build-and-push-images (pull_request) Successful in 1m19s
2024-09-22 14:41:38 +01:00
e8c5ac9939 Merge pull request 'Call the write next datetime function when sending to the channel' (#17) from fix-schedule-send-button into main
All checks were successful
Test, Build and Publish / test (push) Successful in 33s
Test, Build and Publish / build-and-push-images (push) Successful in 1m16s
Reviewed-on: #17
2024-09-22 14:40:35 +01:00
6d6f9d25f9 Update the readme with the new cadence value
Some checks failed
Test, Build and Publish / test (pull_request) Failing after 13m0s
Test, Build and Publish / build-and-push-images (pull_request) Has been cancelled
2024-09-22 14:30:27 +01:00
4 changed files with 63 additions and 7 deletions

View file

@ -17,7 +17,7 @@ Matchy supports a bunch of user, `matcher` and bot owner commands. `/` commands
| /pause | user | Pauses the user for `days: int` days | | /pause | user | Pauses the user for `days: int` days |
| /list | user | Lists the current matchees and scheduled matches | | /list | user | Lists the current matchees and scheduled matches |
| /match | user* | Shares a preview of the matchee groups of size `group_min: int` with the user. *Offers a button to post the match to `matcher` users | | /match | user* | Shares a preview of the matchee groups of size `group_min: int` with the user. *Offers a button to post the match to `matcher` users |
| /schedule | `matcher` | Schedules a match every week with `group_min: int` users on `weekday: int` day and at `hour: int` hour. Can pass `cancel: True` to stop the schedule | | /schedule | `matcher` | Schedules a match every week with `group_min: int` users on `weekday: int` and at `hour: int`, on a weekly `cadence: int`.<br>Can pass `cancel: True` to stop the schedule |
| /cancel | `matcher` | Cancels any scheduled matches in this channel | | /cancel | `matcher` | Cancels any scheduled matches in this channel |
| $sync | bot owner | Syncs bot command data with the discord servers | | $sync | bot owner | Syncs bot command data with the discord servers |
| $close | bot owner | Closes the bot connection so the bot quits safely | | $close | bot owner | Closes the bot connection so the bot quits safely |

View file

@ -210,15 +210,28 @@ 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)
for (channel, _) in state.State.get_active_match_tasks(datetime.now() + timedelta(days=1)): # Send a reminder to threads for a match that happened two days ago
logger.info("Reminding about scheduled task in %s", channel) 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)) msg_channel = self.bot.get_channel(int(channel))
await msg_channel.send(strings.reminder()) # 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 # Increment when adjusting the custom_id so we don't confuse old users
@ -272,11 +285,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

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

View file

@ -1,8 +1,8 @@
coverage==7.6.1 coverage==7.6.10
discord.py==2.4.0 discord.py==2.4.0
dpytest==0.7.0 dpytest==0.7.0
flake8==7.1.1 flake8==7.1.1
pytest==8.3.3 pytest==8.3.3
pytest-asyncio==0.24.0 pytest-asyncio==0.25.2
pytest-cov==5.0.0 pytest-cov==5.0.0
schema==0.7.7 schema==0.7.7