WIP: Refactor Aurora (3.0.0) #29

Draft
cswimr wants to merge 347 commits from aurora-pydantic into main
Showing only changes of commit 557ac45fcc - Show all commits

View file

@ -5,7 +5,6 @@ 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.json import dumps
from aurora.utilities.utils import generate_dict from aurora.utilities.utils import generate_dict
@ -80,6 +79,7 @@ class Moderation(AuroraGuildModel):
def update(self): def update(self):
from aurora.utilities.database import connect from aurora.utilities.database import connect
from aurora.utilities.json import dumps
query = f"UPDATE moderation_{self.guild_id} SET timestamp = ?, moderation_type = ?, target_type = ?, moderator_id = ?, role_id = ?, duration = ?, end_timestamp = ?, reason = ?, resolved = ?, resolved_by = ?, resolve_reason = ?, expired = ?, changes = ?, metadata = ? WHERE moderation_id = ?;" query = f"UPDATE moderation_{self.guild_id} SET timestamp = ?, moderation_type = ?, target_type = ?, moderator_id = ?, role_id = ?, duration = ?, end_timestamp = ?, reason = ?, resolved = ?, resolved_by = ?, resolve_reason = ?, expired = ?, changes = ?, metadata = ? WHERE moderation_id = ?;"
changes = [change.to_json() for change in self.changes] changes = [change.to_json() for change in self.changes]