From 461f52a1d15f733b0bff69cb752bcd13e8fe2ed3 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 15 Dec 2023 21:46:06 -0500 Subject: [PATCH] fix(moderation): fixed NotFound errors --- moderation/moderation.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 061d9cc..c05d071 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -1693,7 +1693,6 @@ class Moderation(commands.Cog): cursor.close() database.commit() - database.close() await interaction.edit_original_response(content="Creating new table...") @@ -1748,8 +1747,13 @@ class Moderation(commands.Cog): 'timestamp': resolve_timestamp } ] + else: + resolved = 0 + resolved_by = 'NULL' + resolved_reason = 'NULL' + changes = [] - await Moderation.mysql_log(self.cog_instance, self.ctx.guild, case['executor'], case['type'], case['target'], 0, duration, case['reason'], timestamp=timestamp, resolved=resolved, resolved_by=resolved_by, resolved_reason=resolved_reason, changes=changes) + await Moderation.mysql_log(self.cog_instance, self.ctx.guild, case['executor'], case['type'], case['target'], 0, duration, case['reason'], timestamp=timestamp, resolved=resolved, resolved_by=resolved_by, resolved_reason=resolved_reason, changes=changes, database=database) await interaction.edit_original_response(content="Import complete.")