WIP: Refactor Aurora (3.0.0) #29

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

View file

@ -5,6 +5,7 @@ from discord import Forbidden, HTTPException, InvalidData, NotFound
from pydantic import BaseModel, ConfigDict from pydantic import BaseModel, ConfigDict
from redbot.core.bot import Red from redbot.core.bot import Red
from aurora.utilities.logger import logger
from aurora.utilities.utils import generate_dict from aurora.utilities.utils import generate_dict
@ -103,6 +104,25 @@ class Moderation(AuroraGuildModel):
)) ))
cursor.close() cursor.close()
logger.info("Updated moderation case %s in guild %s with the following data:\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s\n%s",
self.moderation_id,
self.guild_id,
self.timestamp,
self.moderation_type,
self.target_type,
self.moderator_id,
self.role_id,
self.duration,
self.end_timestamp,
self.reason,
self.resolved,
self.resolved_by,
self.resolve_reason,
self.expired,
dumps(self.changes).strip('"').replace('\\"', '"'),
dumps(self.metadata).strip('"').replace('\\"', '"'),
)
@classmethod @classmethod
def from_sql(cls, bot: Red, moderation_id: int, guild_id: int) -> Optional["Moderation"]: def from_sql(cls, bot: Red, moderation_id: int, guild_id: int) -> Optional["Moderation"]:
from aurora.utilities.database import connect from aurora.utilities.database import connect