forked from cswimr/SeaCogs
fix(moderation): close database/cursor
This commit is contained in:
parent
56d316b6fa
commit
d3bd68f9b0
1 changed files with 3 additions and 2 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue