diff --git a/main.py b/main.py index 867c87e..07f790a 100644 --- a/main.py +++ b/main.py @@ -371,9 +371,9 @@ class LabCleaningBot: case Ok(AcceptInTime()) | Ok(AcceptAfterRejectAllowed()): response_msg = f"""Thank you! You accepted the request. -I will add you to a signal group dedicated for this task. You can not directly leave the signal group until the task has started. +I will add you to a signal group dedicated for this task. Please do not leave this group until the task is completed. You will automatically re-added if you leave prior to the start of the task. -If due to any reason you can not participate, please just change your "👍" reaction above to something else or remove the reaction. I will let the others know that you can not participate, remove you from the group and ask another person to overtake your task. +If you can not participate unexpectedly, please just change your "👍" reaction above to something else or remove the reaction. I will let the others know that you can not participate, remove you from the group and ask another person to take over your tasks. As soon as {request.task.required_number_of_participants} people joined the task, I will let you know. Then you can start coordinate with your group.""" @@ -393,7 +393,7 @@ As soon as {request.task.required_number_of_participants} people joined the task recipients=[request.task.chatgroup])) case Err(AcceptAfterRejectExpired()): - response_msg = "You cannot accept the request after rejecting it after 5 minutes." + response_msg = "You can only change your mind within the first 5 minutes after rejecting the task." case Err(AlreadyAccepted()): response_msg = "You already accepted the request." case Err(AcceptAfterTimeout()): @@ -403,12 +403,12 @@ As soon as {request.task.required_number_of_participants} people joined the task match reject_result: case Ok(RejectInTime()): - response_msg = "You rejected the request. I will ask another person to overtake the task." + response_msg = "You rejected the request. I will ask another person to take over the task." case Ok(RejectAfterAccept()): - response_msg = "You rejected the request after accepting it. I will remove you from the group now and ask another person to overtake the task." + response_msg = "You rejected the request after accepting it. I will remove you from the group now and ask another person to take over the task." self.api.send_message(SendMessageSimple( - message="Person will be removed now, since they rejected the request after initially accepting the task. This is most likely because the person does not have time anymore, something unexpected came up for the person or something else. I will ask another person to overtake the task. If this is not possible, I will let you know in a separate message below.", + message="Person will be removed now, since they rejected the request after initially accepting the task. This is most likely because the person does not have time anymore, something unexpected came up for the person or something else. I will ask another person to take over the task. If this is not possible, I will let you know in a separate message below.", recipients=[request.task.chatgroup])) case Err(AlreadyRejected()): @@ -501,7 +501,7 @@ You have been requested to participate in the task: {task.name} ({task.required_ To accept the request, react with 👍. To reject, react with any other emoji. -You have time to answer for {format_seconds(task.timeout)}.""" +Please answer within {format_seconds(task.timeout)}.""" message = SendMessageSimple(message=text, recipients=[request.user.name]) res = self.api.send_message(message) diff --git a/putzen.sh b/putzen.sh index 55abd35..3cd41c1 100644 --- a/putzen.sh +++ b/putzen.sh @@ -7,26 +7,33 @@ else week=$1 fi +current_week=$(date +%V) +next_week=$((current_week + 1)) +if [ "$next_week" -gt 52 ]; then + next_week=1 +fi + +task_title="LeineLab putzen: KW$next_week" case $week in 0) /usr/bin/docker exec lab-signal-bot-lab-bot-1 \ - python create_task.py "LeineLab putzen" 2 "in 7 days" \ + python create_task.py "$task_title" 2 "in 7 days" \ --pad-template-url "https://pad.leinelab.org/leinelab-putzen-only-weekly" ;; 1) /usr/bin/docker exec lab-signal-bot-lab-bot-1 \ - python create_task.py "LeineLab putzen" 4 "in 7 days" \ + python create_task.py "$task_title" 4 "in 7 days" \ --pad-template-url "https://pad.leinelab.org/leinelab-putzen-fortnightly" ;; 2) /usr/bin/docker exec lab-signal-bot-lab-bot-1 \ - python create_task.py "LeineLab putzen" 4 "in 7 days" \ + python create_task.py "$task_title" 4 "in 7 days" \ --pad-template-url "https://pad.leinelab.org/leinelab-putzen-monthly" ;; 3) /usr/bin/docker exec lab-signal-bot-lab-bot-1 \ - python create_task.py "LeineLab putzen" 4 "in 7 days" \ + python create_task.py "$task_title" 4 "in 7 days" \ --pad-template-url "https://pad.leinelab.org/leinelab-putzen-fortnightly" ;; *)