WIP: Refactor Aurora (3.0.0) #29
1 changed files with 4 additions and 1 deletions
|
@ -177,6 +177,9 @@ class Moderation(AuroraGuildModel):
|
|||
for change in changes:
|
||||
change_obj_list.append(Change.from_dict(bot=bot, data=change))
|
||||
|
||||
if result[15] is not None:
|
||||
metadata = json.loads(result[15])
|
||||
|
||||
case = {
|
||||
"moderation_id": int(result[0]),
|
||||
"guild_id": int(guild_id),
|
||||
|
@ -194,7 +197,7 @@ class Moderation(AuroraGuildModel):
|
|||
"resolve_reason": result[12],
|
||||
"expired": bool(result[13]),
|
||||
"changes": change_obj_list if result[14] else [],
|
||||
"metadata": json.loads(result[15].replace('\\"', '"').replace('["{', '[{').replace('}"]', '}]')) if result[15] else {},
|
||||
"metadata": metadata if result[15] else {},
|
||||
}
|
||||
return cls.from_dict(bot=bot, data=case)
|
||||
|
||||
|
|
Loading…
Reference in a new issue