From d1d5bec73292d2acef116aac878e474a30627b14 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 6 Oct 2023 09:53:59 -0400 Subject: [PATCH] fix(moderation): fixed resolve not commiting its database changes --- moderation/moderation.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/moderation/moderation.py b/moderation/moderation.py index 25d951a..7834f16 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -481,12 +481,15 @@ class Moderation(commands.Cog): else: resolve_query = f"UPDATE `{db}`.`moderation_{interaction.guild.id}` SET resolved = 1, resolve_reason = %s WHERE moderation_id = %s" cursor.execute(resolve_query, (reason, case_number)) + database.commit() response_query = "SELECT * FROM moderation_%s WHERE moderation_id = %s;" cursor.execute(response_query, (interaction.guild.id, case_number)) result = cursor.fetchone() case_dict = self.generate_dict(result) embed = await self.embed_factory('case', interaction=interaction, case_dict=case_dict) await interaction.response.send_message(content=f"✅ Moderation #{case_number} resolved!", embed=embed) + cursor.close() + database.close() @app_commands.command(name="case") async def case(self, interaction: discord.Interaction, case_number: int, ephemeral: bool = False):