aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh-007 <[email protected]>2021-12-13 15:31:30 +0530
committerGravatar Shivansh-007 <[email protected]>2021-12-13 15:31:30 +0530
commit82eca3d65cc492d8c91ccf001c05f55a2acd0197 (patch)
treeed6d059231328be488d6c4ed26a8b85ca5ac5b19
parentFix typos (diff)
Make max modpings off check more explicit
-rw-r--r--bot/exts/moderation/modpings.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/bot/exts/moderation/modpings.py b/bot/exts/moderation/modpings.py
index c7417192c..1aab6555b 100644
--- a/bot/exts/moderation/modpings.py
+++ b/bot/exts/moderation/modpings.py
@@ -223,7 +223,7 @@ class ModPings(Cog):
You can have the modpings role off for a maximum of 16 hours i.e. having the modpings role
on for a minimum of 8 hours in a day.
- The command excepts two arguments `start` and `end` which represent hour and minute of a day,
+ The command expects two arguments `start` and `end` which represent hour and minute of a day,
you would get the modpings role at `start` and it would removed from you at `end`. `start` and
`end` can be in the following formats:
- H:Mam/pm (10:14pm)
@@ -238,7 +238,9 @@ class ModPings(Cog):
if end < start:
end += datetime.timedelta(days=1)
- if datetime.timedelta(hours=24) - (end - start) > datetime.timedelta(hours=MAXIMUM_WORK_OFF_LIMIT):
+ modpings_on_period = end - start
+ # Check if the modpings off period for a day is more than the max
+ if datetime.timedelta(hours=24) - modpings_on_period > datetime.timedelta(hours=MAXIMUM_WORK_OFF_LIMIT):
await ctx.send(
f":x: {ctx.author.mention} You can't have the modpings role off for"
f" more than {MAXIMUM_WORK_OFF_LIMIT} hours!"