diff options
| author | 2021-12-09 23:05:42 +0530 | |
|---|---|---|
| committer | 2021-12-09 23:05:42 +0530 | |
| commit | 3dda75457f5f9ecf5fd7969dcf351d747141a244 (patch) | |
| tree | 29b834b32bd31d6bf61449ffc4530c583b02cc9a | |
| parent | Add day duration convertor (diff) | |
Make 16hours the max off time and not on
Reference: https://discord.com/channels/267624335836053506/635950537262759947/918455823921995826
| -rw-r--r-- | bot/exts/moderation/modpings.py | 10 |
1 files 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 <start> and removed at <end> 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 |