fix(aurora): changed how moderation changes are added. only log the information that is actually changed, and not everything
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Successful in 29s
Actions / Lint Code (Ruff & Pylint) (pull_request) Failing after 41s

This commit is contained in:
Seaswimmer 2024-08-19 17:19:01 -04:00
parent dc407c1125
commit 0c2cde1a78
Signed by: cswimr
GPG key ID: 3813315477F26F82
2 changed files with 4 additions and 4 deletions

View file

@ -1087,10 +1087,10 @@ class Aurora(commands.Cog):
moderation.changes.append(Change.from_dict(interaction.client, {
"type": "EDIT",
"timestamp": int(time.time()),
"reason": moderation.reason,
"reason": reason if reason else None,
"user_id": interaction.user.id,
"duration": timedelta_to_string(old_moderation.duration),
"end_timestamp": moderation.end_timestamp,
"duration": timedelta_to_string(moderation.duration) if duration else None,
"end_timestamp": moderation.end_timestamp if duration else None,
}))
await moderation.update()

View file

@ -14,7 +14,7 @@ class Change(AuroraBaseModel):
type: Literal["ORIGINAL", "RESOLVE", "EDIT"]
timestamp: datetime
user_id: int
reason: Optional[str] = "No reason provided"
reason: Optional[str] = None
duration: Optional[timedelta] = None
end_timestamp: Optional[datetime] = None