fix(aurora): added logging for the Moderation.update() method
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 29s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 45s

This commit is contained in:
Seaswimmer 2024-05-04 22:17:52 -04:00
parent 04d10d2cf8
commit acf3b0c68f
Signed by: cswimr
GPG key ID: 5D671B5D03D65A7F

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