WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
2 changed files with 2 additions and 2 deletions
Showing only changes of commit 1313834ea5 - Show all commits

View file

@ -101,7 +101,7 @@ class Change(AuroraBaseModel):
return await PartialUser.from_id(self.bot, self.user_id) return await PartialUser.from_id(self.bot, self.user_id)
@classmethod @classmethod
def from_dict(cls, bot: Red, data: dict) -> "Change": def from_dict(cls, bot: Red, guild_id: int, data: dict) -> "Change":
return cls(bot=bot, **data) return cls(bot=bot, **data)
class PartialUser(AuroraBaseModel): class PartialUser(AuroraBaseModel):

View file

@ -137,7 +137,7 @@ def generate_dict(bot: Red, result: dict, guild_id: int) -> dict:
changes = json.loads(result[14].strip('"').replace('\\"', '"')) changes = json.loads(result[14].strip('"').replace('\\"', '"'))
change_obj_list = [] change_obj_list = []
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, guild_id=guild_id, data=change))
case = { case = {
"moderation_id": int(result[0]), "moderation_id": int(result[0]),