fix(moderation): close database/cursor

This commit is contained in:
Seaswimmer 2023-12-18 16:35:38 -05:00
parent 56d316b6fa
commit d3bd68f9b0
Signed by: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -585,9 +585,10 @@ 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)
cursor.close()
database.close()
return
cursor = database.cursor()