From d3bd68f9b08ea4120943814271b7ae2d6e4d491c Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Mon, 18 Dec 2023 16:35:38 -0500 Subject: [PATCH] fix(moderation): close database/cursor --- moderation/moderation.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 253ac76..6b9b97c 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -585,10 +585,11 @@ class Moderation(commands.Cog): await interaction.followup.send(file=discord.File(filename, f"moderation_{interaction.guild.id}.json"), ephemeral=ephemeral) os.remove(filename) - return except json.JSONDecodeError as e: await interaction.followup.send(content=f"An error occured while exporting the moderation history.\nError:\n```{e}```", ephemeral=ephemeral) - return + cursor.close() + database.close() + return cursor = database.cursor()