WIP: Moderation type registry #26
1 changed files with 20 additions and 0 deletions
|
@ -5,6 +5,7 @@ from discord import Forbidden, HTTPException, InvalidData, NotFound
|
|||
from pydantic import BaseModel, ConfigDict
|
||||
from redbot.core.bot import Red
|
||||
|
||||
from aurora.utilities.logger import logger
|
||||
from aurora.utilities.utils import generate_dict
|
||||
|
||||
|
||||
|
@ -103,6 +104,25 @@ class Moderation(AuroraGuildModel):
|
|||
))
|
||||
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
|
||||
def from_sql(cls, bot: Red, moderation_id: int, guild_id: int) -> Optional["Moderation"]:
|
||||
from aurora.utilities.database import connect
|
||||
|
|
Loading…
Reference in a new issue