aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2019-12-04 15:04:20 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2019-12-04 15:04:20 +0700
commit82eb5e1c46e378a6f3778e17cc342193b910ded5 (patch)
treea590413b3fdc75b26fb36f477fe263110b6869fe
parentCreated `until_expiration` to get the remaining time until the infraction exp... (diff)
Implemented remaining time until expiration for infraction searching.
Will show the remaining time, `Expired.` or `Inactive.` based on the status of the infraction ( It can be inactive but not expired, like an early unmute )
-rw-r--r--bot/cogs/moderation/management.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index abfe5c2b3..2f5e09f1b 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -232,6 +232,12 @@ class ModManagement(commands.Cog):
user_id = infraction["user"]
hidden = infraction["hidden"]
created = time.format_infraction(infraction["inserted_at"])
+
+ if active:
+ remaining = time.until_expiration(infraction["expires_at"]) or 'Expired.'
+ else:
+ remaining = 'Inactive.'
+
if infraction["expires_at"] is None:
expires = "*Permanent*"
else:
@@ -247,6 +253,7 @@ class ModManagement(commands.Cog):
Reason: {infraction["reason"] or "*None*"}
Created: {created}
Expires: {expires}
+ Remaining: {remaining}
Actor: {actor.mention if actor else actor_id}
ID: `{infraction["id"]}`
{"**===============**" if active else "==============="}