aboutsummaryrefslogtreecommitdiffstats
path: root/bot/cogs/moderation.py
diff options
context:
space:
mode:
authorGravatar MarkKoz <[email protected]>2019-09-27 11:37:38 -0700
committerGravatar MarkKoz <[email protected]>2019-10-01 18:25:32 -0700
commit15aeccf4e4e1795792b92d5d9b33ce049a43afbc (patch)
treef8fe80a008d8106fcd50c656978365188ad81b5f /bot/cogs/moderation.py
parentUse lowercase infraction types (diff)
Format infraction timestamp inside send_messages
Diffstat (limited to '')
-rw-r--r--bot/cogs/moderation.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/bot/cogs/moderation.py b/bot/cogs/moderation.py
index 457eac2bb..e0a5f71a9 100644
--- a/bot/cogs/moderation.py
+++ b/bot/cogs/moderation.py
@@ -756,12 +756,10 @@ class Moderation(Scheduler, Cog):
Returns a boolean indicator of whether the DM was successful.
"""
- expires_at = format_infraction(expires_at) if expires_at else "N/A"
-
embed = Embed(
description=textwrap.dedent(f"""
**Type:** {infr_type.capitalize()}
- **Expires:** {expires_at}
+ **Expires:** {expires_at or "N/A"}
**Reason:** {reason or "No reason provided."}
"""),
colour=Colour(Colours.soft_red)
@@ -836,6 +834,9 @@ class Moderation(Scheduler, Cog):
reason = infraction["reason"]
expiry = infraction["expires_at"]
+ if expiry:
+ expiry = format_infraction(expiry)
+
dm_result = ""
dm_log_text = ""
log_content = None