From bde7c6908645c93f0394e5d8cd7a2e3511fc0aa1 Mon Sep 17 00:00:00 2001 From: SeaswimmerTheFsh Date: Thu, 14 Dec 2023 19:41:25 -0500 Subject: [PATCH] fix(moderation): assume case['changes'] is already a list --- moderation/moderation.py | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/moderation/moderation.py b/moderation/moderation.py index 7873d4a..a05314c 100644 --- a/moderation/moderation.py +++ b/moderation/moderation.py @@ -1130,10 +1130,22 @@ class Moderation(commands.Cog): if conf: raise(LookupError) - changes: list = json.loads(case['changes']) + changes: list = case['changes'] if not changes: - changes.append({'timestamp': case['timestamp'], 'reason': case['reason'], 'user_id': case['moderator_id']}) - changes.append({'timestamp': int(time.time()), 'reason': reason, 'user_id': interaction.user.id}) + changes.append( + { + 'timestamp': case['timestamp'], + 'reason': case['reason'], + 'user_id': case['moderator_id'] + } + ) + changes.append( + { + 'timestamp': int(time.time()), + 'reason': reason, + 'user_id': interaction.user.id + } + ) database = await self.connect() cursor = database.cursor()