fix(moderation): assume case['changes'] is already a list
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 46s

This commit is contained in:
Seaswimmer 2023-12-14 19:41:25 -05:00
parent c7e84c40d1
commit bde7c69086
Signed by: 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()