diff options
author | 2021-06-13 12:27:03 +0530 | |
---|---|---|
committer | 2021-06-13 12:27:03 +0530 | |
commit | ced656c7518e35626e17d165976283f3d894d722 (patch) | |
tree | aef1a994a3174663772f1bfa25152bd114be76b3 | |
parent | (modpings): Use scheduling.create_task wrapper (diff) |
(modpings): 16 hours is the maximum schedule limit
-rw-r--r-- | bot/exts/moderation/modpings.py | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/bot/exts/moderation/modpings.py b/bot/exts/moderation/modpings.py index f0a1ce590..c0e742699 100644 --- a/bot/exts/moderation/modpings.py +++ b/bot/exts/moderation/modpings.py @@ -14,7 +14,7 @@ from bot.utils.scheduling import Scheduler, create_task log = logging.getLogger(__name__) -MINIMUM_WORK_LIMIT = 16 +MAXIMUM_WORK_LIMIT = 16 class ModPings(Cog): @@ -192,12 +192,12 @@ class ModPings(Cog): if end < start: end += datetime.timedelta(days=1) - # if (end - start) < datetime.timedelta(hours=MINIMUM_WORK_LIMIT): - # await ctx.send( - # f":x: {ctx.author.mention} You need to have the role on for " - # f"a minimum of {MINIMUM_WORK_LIMIT} hours!" - # ) - # return + if (end - start) > datetime.timedelta(hours=MAXIMUM_WORK_LIMIT): + await ctx.send( + f":x: {ctx.author.mention} You can't have the modpings role for" + f" more than {MAXIMUM_WORK_LIMIT} hours!" + ) + return start, end = start.replace(tzinfo=None), end.replace(tzinfo=None) work_time = (end - start).total_seconds() |