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