From 5177cdec848c852a201f8d4aec725faec51f5950 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 18 Dec 2023 18:50:18 -0500 Subject: [PATCH] fix(moderation): fixed durations in evidenceformat --- moderation/utilities/embed_factory.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/moderation/utilities/embed_factory.py b/moderation/utilities/embed_factory.py index 7e77b2b..b22d57a 100644 --- a/moderation/utilities/embed_factory.py +++ b/moderation/utilities/embed_factory.py @@ -138,7 +138,9 @@ async def embed_factory(embed_type: str, color: Color, /, interaction: Interact content = f"{codeblock}prolog\nCase: {case_dict['moderation_id']:,} ({str.title(case_dict['moderation_type'])})\nTarget: {target_name} ({target_user['id']})\nModerator: {moderator_name} ({moderator_user['id']})" if case_dict['duration'] != 'NULL': - content += f"Duration: {humanize.precisedelta(case_dict['duration'])}" + hours, minutes, seconds = map(int, case_dict['duration'].split(':')) + td = timedelta(hours=hours, minutes=minutes, seconds=seconds) + content += f"\nDuration: {humanize.precisedelta(td)}" content += f"\nReason: {case_dict['reason']}{codeblock}"