fix(moderation): assume case['changes'] is already a list

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

View file

@ -1130,10 +1130,22 @@ class Moderation(commands.Cog):
if conf: if conf:
raise(LookupError) raise(LookupError)
changes: list = json.loads(case['changes']) changes: list = case['changes']
if not changes: if not changes:
changes.append({'timestamp': case['timestamp'], 'reason': case['reason'], 'user_id': case['moderator_id']}) changes.append(
changes.append({'timestamp': int(time.time()), 'reason': reason, 'user_id': interaction.user.id}) {
'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() database = await self.connect()
cursor = database.cursor() cursor = database.cursor()