fix(aurora): fixed the Moderation.update() method being broken
Some checks failed
Actions / Build Documentation (MkDocs) (pull_request) Failing after 26s
Actions / Lint Code (Ruff & Pylint) (pull_request) Successful in 43s

This commit is contained in:
Seaswimmer 2024-07-12 16:33:00 -04:00
parent 6edda87baa
commit 7f0bd8c1a8
Signed by: cswimr
GPG key ID: 3813315477F26F82

View file

@ -132,27 +132,6 @@ class Moderation(AuroraGuildModel):
success, msg = await self.type.resolve_handler(moderation=self, reason=reason) success, msg = await self.type.resolve_handler(moderation=self, reason=reason)
# if self.type in ["UNMUTE", "UNBAN"]:
# raise TypeError("Cannot resolve an unmute or unban case!")
# if self.type == "MUTE":
# try:
# guild: discord.Guild = await self.bot.fetch_guild(self.guild_id)
# member = await guild.fetch_member(self.target_id)
# await member.timeout(
# None, reason=f"Case {self.moderation_id} resolved by {resolved_by}{' for '+ reason if reason else ''}"
# )
# except NotFound:
# pass
# if self.type in ["BAN", "TEMPBAN"]:
# try:
# guild: discord.Guild = await self.bot.fetch_guild(self.guild_id)
# await guild.unban(await self.get_target(), reason=f"Case {self.moderation_id} resolved by {resolved_by}{' for '+ reason if reason else ''}")
# except NotFound:
# pass
if not self.changes: if not self.changes:
self.changes.append(Change.from_dict(self.bot, { self.changes.append(Change.from_dict(self.bot, {
"type": "ORIGINAL", "type": "ORIGINAL",
@ -178,7 +157,7 @@ class Moderation(AuroraGuildModel):
await self.execute(query, ( await self.execute(query, (
self.timestamp.timestamp(), self.timestamp.timestamp(),
self.moderation_type.moderation_type, self.moderation_type.key,
self.target_type, self.target_type,
self.moderator_id, self.moderator_id,
self.role_id, self.role_id,
@ -198,7 +177,7 @@ class Moderation(AuroraGuildModel):
self.moderation_id, self.moderation_id,
self.guild_id, self.guild_id,
self.timestamp.timestamp(), self.timestamp.timestamp(),
self.moderation_type, self.moderation_type.key,
self.target_type, self.target_type,
self.moderator_id, self.moderator_id,
self.role_id, self.role_id,