fix(moderation): dump changes to json before adding to mysql database

This commit is contained in:
Seaswimmer 2023-12-14 19:42:19 -05:00
parent bde7c69086
commit 43528397e8
Signed by untrusted user: cswimr
GPG key ID: 1EBC234EEDA901AE

View file

@ -1152,7 +1152,7 @@ class Moderation(commands.Cog):
db = await self.config.mysql_database()
update_query = f"UPDATE `{db}`.`moderation_{interaction.guild.id}` SET changes = %s, reason = %s WHERE moderation_id = %s"
cursor.execute(update_query, (changes, reason, case_number))
cursor.execute(update_query, (json.dumps(changes), reason, case_number))
database.commit()
new_case = await self.fetch_case(case_number, interaction.guild.id)