fix(moderation): assume case['changes'] is already a list
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 46s
Some checks failed
Pylint / Pylint (3.10) (push) Failing after 46s
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:
|
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()
|
||||||
|
|
Loading…
Reference in a new issue