From e6b8a0445cc38840f53e09cf8ce4b289f71edd58 Mon Sep 17 00:00:00 2001 From: lemoer Date: Sat, 28 Dec 2024 14:13:15 +0100 Subject: [PATCH] LabCleaningBot: improve verbosity for users --- main.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/main.py b/main.py index 778d053..01fb4d0 100644 --- a/main.py +++ b/main.py @@ -458,8 +458,11 @@ If due to any reason you can not participate, please just change your "👍" rea reqs = task.create_additional_requests(now(), session) if is_err(reqs): - if task not in unfulfillable_tasks: + if task not in unfulfillable_tasks and len(task.accepted_requests()) > 0: print("Could not fulfill task: " + task.name) + additional_requested_users = [r.user.name for r in task.requested_requests()] + + self.api.send_message(SendMessageSimple(message=f"It was planned to do this task with {task.required_number_of_participants} participants. There are currently {len(additional_requested_users)} unanswered requests. However, currently, no additional users are left to request for this task. Please try to fulfill the tasks as good as you are able to within your group or ask other people directly if they can join your group.", recipients=[task.chatgroup])) unfulfillable_tasks.append(task) @@ -471,7 +474,7 @@ If due to any reason you can not participate, please just change your "👍" rea seconds_to_due = (task.due - request.requested_at).total_seconds() text = f"""Hi! -You have been requested to participate in the task: {task.name} (starts in {format_seconds(seconds_to_due)}). +You have been requested to participate in the task: {task.name} ({task.required_number_of_participants} participants desired, starts in {format_seconds(seconds_to_due)}). To accept the request, react with 👍. To reject, react with any other emoji.