WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
Showing only changes of commit 101d364241 - Show all commits

View file

@ -4,7 +4,6 @@ from typing import Literal, Optional
from redbot.core.bot import Red from redbot.core.bot import Red
from ..utilities.logger import logger
from ..utilities.utils import timedelta_from_string from ..utilities.utils import timedelta_from_string
from .base import AuroraBaseModel from .base import AuroraBaseModel
from .partials import PartialUser from .partials import PartialUser
@ -38,8 +37,6 @@ class Change(AuroraBaseModel):
def from_dict(cls, bot: Red, data: dict) -> "Change": def from_dict(cls, bot: Red, data: dict) -> "Change":
if isinstance(data, str): if isinstance(data, str):
data = json.loads(data) data = json.loads(data)
if data.get('duration'):
logger.debug(f"Duration: {data['duration']}")
if data.get('duration') and not isinstance(data["duration"], timedelta) and not data["duration"] == "NULL": if data.get('duration') and not isinstance(data["duration"], timedelta) and not data["duration"] == "NULL":
duration = timedelta_from_string(data["duration"]) duration = timedelta_from_string(data["duration"])
elif data.get('duration') and isinstance(data["duration"], timedelta): elif data.get('duration') and isinstance(data["duration"], timedelta):