From 331dece8593aefb6739c6b0415dae99ea8a2d6cd Mon Sep 17 00:00:00 2001 From: Conatum Date: Tue, 11 Jan 2022 17:55:22 +0200 Subject: [PATCH] (timer): Lower limit on stage length. --- bot/modules/study/timers/commands.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/bot/modules/study/timers/commands.py b/bot/modules/study/timers/commands.py index 77fec0d8..305d3021 100644 --- a/bot/modules/study/timers/commands.py +++ b/bot/modules/study/timers/commands.py @@ -276,6 +276,12 @@ async def _pomo_admin(ctx, flags): break_length = int(breaksplits[0]) channelname = breaksplits[1].strip() if len(breaksplits) > 1 else None + # Check the stages aren't too short + if focus_length < 5: + return await ctx.error_reply("The focus duration must be at least 5 minutes!") + if break_length < 5: + return await ctx.error_reply("The break duration must be at least 5 minutes!") + # Create or update the timer if not timer: # Create timer