aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shirayuki Nekomata <[email protected]>2019-11-27 15:42:19 +0700
committerGravatar Shirayuki Nekomata <[email protected]>2019-11-27 15:42:19 +0700
commit2dc74fc6d97e32cbb9cad1dd2797b02a669b3793 (patch)
treefc02195be5f7251fa17adf6920f51da33bf16467
parentFixed "14 minutes, 60 seconds" by rounding `.total_seconds()` in `bot.utils.t... (diff)
Added duration until expiration for infraction searching.
-rw-r--r--bot/cogs/moderation/management.py7
1 files changed, 5 insertions, 2 deletions
diff --git a/bot/cogs/moderation/management.py b/bot/cogs/moderation/management.py
index 44a508436..5c63b19ce 100644
--- a/bot/cogs/moderation/management.py
+++ b/bot/cogs/moderation/management.py
@@ -2,6 +2,7 @@ import asyncio
import logging
import textwrap
import typing as t
+from datetime import datetime
import discord
from discord.ext import commands
@@ -97,7 +98,8 @@ class ModManagement(commands.Cog):
elif duration is not None:
request_data['expires_at'] = duration.isoformat()
expiry = duration.strftime(time.INFRACTION_FORMAT)
- confirm_messages.append(f"set to expire on {expiry}")
+ duration_string = time.get_duration(duration, datetime.utcnow())
+ confirm_messages.append(f"set to expire on {expiry} ({duration_string})")
else:
confirm_messages.append("expiry unchanged")
@@ -234,7 +236,8 @@ class ModManagement(commands.Cog):
if infraction["expires_at"] is None:
expires = "*Permanent*"
else:
- expires = time.format_infraction(infraction["expires_at"])
+ duration = time.get_duration_from_expiry(infraction["expires_at"])
+ expires = f"{time.format_infraction(infraction['expires_at'])} ({duration})"
lines = textwrap.dedent(f"""
{"**===============**" if active else "==============="}