aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-04-09 08:12:09 +0300
committerGravatar ks129 <[email protected]>2020-04-09 08:12:09 +0300
commit8d283fb8eefd7be288702f88653aaebcdcda37c3 (patch)
tree2ebb8b83649719e7f41efd6861c6302450a7d9cd
parent(Superstarify): Removed unnecessary truncation on `superstarify` command, reo... (diff)
(Mod Utils): Moved embed description to variable.
-rw-r--r--bot/cogs/moderation/utils.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/bot/cogs/moderation/utils.py b/bot/cogs/moderation/utils.py
index 0423e5373..fc8c26031 100644
--- a/bot/cogs/moderation/utils.py
+++ b/bot/cogs/moderation/utils.py
@@ -131,12 +131,14 @@ async def notify_infraction(
"""DM a user about their new infraction and return True if the DM is successful."""
log.trace(f"Sending {user} a DM about their {infr_type} infraction.")
+ text = textwrap.dedent(f"""
+ **Type:** {infr_type.capitalize()}
+ **Expires:** {expires_at or "N/A"}
+ **Reason:** {reason or "No reason provided."}
+ """)
+
embed = discord.Embed(
- description=textwrap.shorten(textwrap.dedent(f"""
- **Type:** {infr_type.capitalize()}
- **Expires:** {expires_at or "N/A"}
- **Reason:** {reason or "No reason provided."}
- """), width=2048, placeholder="..."),
+ description=textwrap.shorten(text, width=2048, placeholder="..."),
colour=Colours.soft_red
)