From e2c165297d53a9cebe96ea81e90668cb7f23b595 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 18 Dec 2023 16:43:28 -0500 Subject: [PATCH] fix(moderation): fixed moderation imports --- moderation/importers/moderation.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/moderation/importers/moderation.py b/moderation/importers/moderation.py index ba75fa7..d48abea 100644 --- a/moderation/importers/moderation.py +++ b/moderation/importers/moderation.py @@ -1,4 +1,4 @@ -from datetime import timedelta +from datetime import timedelta, strptime import json from redbot.core import commands from discord import Message, ButtonStyle, Interaction, ui @@ -69,6 +69,13 @@ class ImportModerationView(ui.View): if 'metadata' not in case or not case['metadata']: case['metadata'] = {} + duration_t = strptime(case['duration'], "%H:%M:%S") + duration = timedelta( + hours=duration_t.hours, + minutes=duration_t.minutes, + seconds=duration_t.seconds + ) + await mysql_log( self.ctx.guild.id, case['moderator_id'], @@ -76,7 +83,7 @@ class ImportModerationView(ui.View): case['target_type'], case['target_id'], case['role_id'], - case['duration'], + duration, case['reason'], timestamp=case['timestamp'], resolved=case['resolved'],