fix(moderation): fixed resolve not commiting its database changes
All checks were successful
Pylint / Pylint (push) Successful in 1m12s
All checks were successful
Pylint / Pylint (push) Successful in 1m12s
This commit is contained in:
parent
bd17b6e88a
commit
d1d5bec732
1 changed files with 3 additions and 0 deletions
|
@ -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):
|
||||
|
|
Loading…
Reference in a new issue