aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Daniel Brown <[email protected]>2019-09-18 10:54:49 -0500
committerGravatar Daniel Brown <[email protected]>2019-09-18 10:54:49 -0500
commit17d6d80a78b8ab66d2f82060cb8334ccd8c62bca (patch)
treeeb6c0a5323fa113bf2e0403f52f6a6f868628fb9
parentMerge pull request #436 from python-discord/enhance-offtopicnames-search (diff)
Infraction Date Humanization
- Changed the date returned on infraction searches to use the `"%c"` strftime format instead of the standard ISO format. Signed-off-by: Daniel Brown <[email protected]>
-rw-r--r--bot/cogs/moderation.py9
1 files changed, 7 insertions, 2 deletions
diff --git a/bot/cogs/moderation.py b/bot/cogs/moderation.py
index c631dd69d..898f053f5 100644
--- a/bot/cogs/moderation.py
+++ b/bot/cogs/moderation.py
@@ -1260,6 +1260,11 @@ class Moderation(Scheduler, Cog):
active = infraction_object["active"]
user_id = infraction_object["user"]
hidden = infraction_object["hidden"]
+ created = datetime.fromisoformat(infraction_object["inserted_at"].strftime("%c"))
+ if not infraction_object["expires_at"]:
+ expires = "*Permanent*"
+ else:
+ expires = datetime.fromisoformat(infraction_object["expires_at"].strftime("%c"))
lines = textwrap.dedent(f"""
{"**===============**" if active else "==============="}
@@ -1268,8 +1273,8 @@ class Moderation(Scheduler, Cog):
Type: **{infraction_object["type"]}**
Shadow: {hidden}
Reason: {infraction_object["reason"] or "*None*"}
- Created: {infraction_object["inserted_at"]}
- Expires: {infraction_object["expires_at"] or "*Permanent*"}
+ Created: {created}
+ Expires: {expires}
Actor: {actor.mention if actor else actor_id}
ID: `{infraction_object["id"]}`
{"**===============**" if active else "==============="}