From 3c9a3dd2727f911c8bffb0ff3abcd1e5f8be9c3e Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 17 May 2022 12:29:16 +0300 Subject: [PATCH] fix (Timer): Correctly handle status content. --- bot/modules/study/timers/Timer.py | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) diff --git a/bot/modules/study/timers/Timer.py b/bot/modules/study/timers/Timer.py index 64989f76..20a60c70 100644 --- a/bot/modules/study/timers/Timer.py +++ b/bot/modules/study/timers/Timer.py @@ -171,17 +171,6 @@ class Timer: content = [] - current_stage = self.current_stage - next_starts = int(current_stage.start.timestamp()) - if current_stage.name == 'BREAK': - content.append( - f"**Have a rest!** Break finishes ." - ) - else: - content.append( - f"**Focus!** Session ends ." - ) - if to_kick: # Do kick await asyncio.gather( @@ -206,9 +195,12 @@ class Timer: old_reaction_message = self.reaction_message # Send status image, add reaction + args = await self.status() + if status_content := args.pop('content', None): + content.append(status_content) self.reaction_message = await self.text_channel.send( content='\n'.join(content), - **(await self.status()) + **args ) await self.reaction_message.add_reaction('✅')