From 3dda75457f5f9ecf5fd7969dcf351d747141a244 Mon Sep 17 00:00:00 2001 From: Shivansh-007 Date: Thu, 9 Dec 2021 23:05:42 +0530 Subject: Make 16hours the max off time and not on Reference: https://discord.com/channels/267624335836053506/635950537262759947/918455823921995826 --- bot/exts/moderation/modpings.py | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/bot/exts/moderation/modpings.py b/bot/exts/moderation/modpings.py index d214601de..c6083387d 100644 --- a/bot/exts/moderation/modpings.py +++ b/bot/exts/moderation/modpings.py @@ -17,7 +17,7 @@ from bot.utils.time import TimestampFormats, discord_timestamp log = get_logger(__name__) -MAXIMUM_WORK_LIMIT = 16 +MAXIMUM_WORK_OFF_LIMIT = 16 class ModPings(Cog): @@ -201,15 +201,13 @@ class ModPings(Cog): @has_any_role(*MODERATION_ROLES) async def schedule_modpings(self, ctx: Context, start: DayDuration, end: DayDuration) -> None: """Schedule modpings role to be added at and removed at everyday at UTC time!""" - print(start, end) - if end < start: end += datetime.timedelta(days=1) - if (end - start) > datetime.timedelta(hours=MAXIMUM_WORK_LIMIT): + if datetime.timedelta(hours=24) - (end - start) > datetime.timedelta(hours=MAXIMUM_WORK_OFF_LIMIT): await ctx.send( - f":x: {ctx.author.mention} You can't have the modpings role for" - f" more than {MAXIMUM_WORK_LIMIT} hours!" + f":x: {ctx.author.mention} You can't have the modpings role off for" + f" more than {MAXIMUM_WORK_OFF_LIMIT} hours!" ) return -- cgit v1.2.3