From 613a2677975e7ad004c826546f281b799c2c4872 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 5 Oct 2023 16:37:01 -0400 Subject: [PATCH] fix(moderation): time until duration expiry only appears now if the moderation hasn't expired yet --- moderation/moderation.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 9838d11..57c8628 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -393,7 +393,8 @@ class Moderation(commands.Cog): embed.description = f"**Type:** {str.title(case['moderation_type'])}\n**Target:** {target_name} ({target.id})\n**Moderator:** {moderator_name} ({moderator.id})\n**Resolved:** {bool(case['resolved'])}\n**Timestamp:** | " if case['duration'] != 'NULL': td = timedelta(**{unit: int(val) for unit, val in zip(["hours", "minutes", "seconds"], case["duration"].split(":"))}) - embed.description = embed.description + f"\n**Duration:** {humanize.precisedelta(td)} | \n**Expired:** {bool(case['expired'])}" + duration_embed = f"{humanize.precisedelta(td)} | " if case["expired"] == '0' else {humanize.precisedelta(td)} + embed.description = embed.description + f"\n**Duration:** {duration_embed}\n**Expired:** {bool(case['expired'])}" embed.add_field(name='Reason', value=f"```{case['reason']}```", inline=False) if case['resolved'] == 1: embed.add_field(name='Resolve Reason', value=f"```{case['resolve_reason']}```", inline=False)