fix(aurora): fixed a logging statement

This commit is contained in:
Seaswimmer 2024-05-06 15:11:11 -04:00
parent 5be5a39c54
commit 16af26f93e
Signed by untrusted user: cswimr
GPG key ID: 5D671B5D03D65A7F

View file

@ -1,3 +1,4 @@
import json
import sqlite3
from datetime import datetime, timedelta
from time import time
@ -106,7 +107,7 @@ class Moderation(AuroraGuildModel):
))
cursor.close()
logger.info("Row updated in moderation_%s!\n%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s",
logger.debug("Row updated in moderation_%s!\n%s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s, %s",
self.moderation_id,
self.guild_id,
self.timestamp.timestamp(),
@ -278,6 +279,9 @@ class Change(AuroraBaseModel):
@classmethod
def from_dict(cls, bot: Red, data: dict) -> "Change":
logger.debug("Creating Change from dict (%s): %s", type(data), data)
if isinstance(data, str):
data = json.loads(data)
logger.debug("Change data was a string, converted to dict: %s", data)
if "duration" in data and data["duration"] and not isinstance(data["duration"], timedelta):
hours, minutes, seconds = map(int, data["duration"].split(':'))
duration = timedelta(hours=hours, minutes=minutes, seconds=seconds)