From 271ecfffa4935bb9e908af609c83e44549d17999 Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 11 Jan 2022 17:51:21 +0200 Subject: [PATCH] (timer): Channel template changes. --- bot/modules/study/timers/Timer.py | 6 +++--- bot/modules/study/timers/commands.py | 8 ++++---- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/bot/modules/study/timers/Timer.py b/bot/modules/study/timers/Timer.py index 9fd97f51..3476d9a2 100644 --- a/bot/modules/study/timers/Timer.py +++ b/bot/modules/study/timers/Timer.py @@ -129,13 +129,13 @@ class Timer: Current name for the voice channel """ stage = self.current_stage - name_format = self.data.channel_name or "{remaining} -- {name}" + name_format = self.data.channel_name or "{remaining} {stage} -- {name}" return name_format.replace( - '{remaining}', "{}m left".format( + '{remaining}', "{}m".format( int(5 * math.ceil((stage.end - utc_now()).total_seconds() / 300)), ) ).replace( - '{stage}', stage.name + '{stage}', stage.name.lower() ).replace( '{members}', str(len(self.channel.members)) ).replace( diff --git a/bot/modules/study/timers/commands.py b/bot/modules/study/timers/commands.py index 39cbf68f..77fec0d8 100644 --- a/bot/modules/study/timers/commands.py +++ b/bot/modules/study/timers/commands.py @@ -143,19 +143,19 @@ async def cmd_pomodoro(ctx, flags): --threshold: How many focus+break cycles before a member is kicked. --text: Text channel to send timer alerts in (defaults to value of `{prefix}config pomodoro_channel`). Channel name substitutions:: - {{remaining}}: The time left in the current focus or break session, e.g. `10m left`. - {{stage}}: The name of the current stage (`FOCUS` or `BREAK`). + {{remaining}}: The time left in the current focus or break session, e.g. `10m`. + {{stage}}: The name of the current stage (`focus` or `break`). {{name}}: The configured timer name. {{pattern}}: The timer pattern in the form `focus/break` (e.g. `50/10`). Examples: Add a timer to your study room with `50` minutes focus, `10` minutes break. > `{prefix}pomodoro 50, 10` Add a timer with a custom updating channel name - > `{prefix}pomodoro 50, 10 {{stage}} {{remaining}} -- {{pattern}} room` + > `{prefix}pomodoro 50, 10 {{remaining}} {{stage}} -- {{pattern}} room` Change the name on the `{prefix}timer` status > `{prefix}pomodoro --name 50/10 study room` Change the updating channel name - > `{prefix}pomodoro --channelname {{remaining}} -- {{name}}` + > `{prefix}pomodoro --channelname {{remaining}} left -- {{name}}` """ await _pomo_admin(ctx, flags)