From 04101cfd1b9a07ca847f977d53552c4fe3f4e61e Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Fri, 12 Jan 2024 07:07:24 +0000 Subject: [PATCH] fix(aurora): fixed exporting moderation history --- aurora/aurora.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/aurora/aurora.py b/aurora/aurora.py index 92f5c3f..405372d 100644 --- a/aurora/aurora.py +++ b/aurora/aurora.py @@ -35,7 +35,7 @@ class Aurora(commands.Cog): This cog stores all of its data in an SQLite database.""" __author__ = "SeaswimmerTheFsh" - __version__ = "2.0.1" + __version__ = "2.0.2" async def red_delete_data_for_user(self, *, requester, user_id: int): if requester == "discord_deleted_user": @@ -585,11 +585,16 @@ class Aurora(commands.Cog): results = cursor.fetchall() + cases = [] + for result in results: + case = dict(result) + cases.append(case) + try: filename = str(data_manager.cog_data_path(cog_instance=self)) + str(os.sep) + f"moderation_{interaction.guild.id}.json" with open(filename, "w", encoding="utf-8") as f: - json.dump(results, f, indent=2) + json.dump(cases, f, indent=2) await interaction.followup.send(file=discord.File(filename, f"moderation_{interaction.guild.id}.json"), ephemeral=ephemeral)