WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
2 changed files with 4 additions and 4 deletions
Showing only changes of commit 0c2cde1a78 - Show all commits

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