WIP: Refactor Aurora (3.0.0) #29
2 changed files with 4 additions and 1 deletions
|
@ -46,7 +46,7 @@ class Aurora(commands.Cog):
|
|||
This cog stores all of its data in an SQLite database."""
|
||||
|
||||
__author__ = ["Seaswimmer"]
|
||||
__version__ = "3.0.0-indev19"
|
||||
__version__ = "3.0.0-indev20"
|
||||
__documentation__ = "https://seacogs.coastalcommits.com/aurora/"
|
||||
|
||||
async def red_delete_data_for_user(self, *, requester, user_id: int):
|
||||
|
|
|
@ -4,6 +4,7 @@ from typing import Literal, Optional
|
|||
|
||||
from redbot.core.bot import Red
|
||||
|
||||
from ..utilities.logger import logger
|
||||
from ..utilities.utils import timedelta_from_string
|
||||
from .base import AuroraBaseModel
|
||||
from .partials import PartialUser
|
||||
|
@ -31,6 +32,8 @@ class Change(AuroraBaseModel):
|
|||
def from_dict(cls, bot: Red, data: dict) -> "Change":
|
||||
if isinstance(data, str):
|
||||
data = json.loads(data)
|
||||
if data.get('duration'):
|
||||
logger.debug(f"Duration: {data['duration']}")
|
||||
if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta) and not data["duration"] == "NULL":
|
||||
duration = timedelta_from_string(data["duration"])
|
||||
elif "duration" in data and isinstance(data["duration"], timedelta):
|
||||
|
|
Loading…
Reference in a new issue