fix(moderation): assume case['changes'] is already a list
This commit is contained in:
parent
c7e84c40d1
commit
bde7c69086
1 changed files with 15 additions and 3 deletions
|
@ -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()
|
||||
|
|
Loading…
Reference in a new issue