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()