diff options
| author | 2022-08-17 17:11:35 -0400 | |
|---|---|---|
| committer | 2022-08-17 17:11:35 -0400 | |
| commit | 6ca8e4822665832609208bd02f2201d5e584479c (patch) | |
| tree | 62c45be999ea624ff51f9724f44dea097a3da733 | |
| parent | feat: add reason argument to pardon commands (diff) | |
fix: lint
| -rw-r--r-- | bot/exts/moderation/infraction/_scheduler.py | 4 | ||||
| -rw-r--r-- | bot/exts/moderation/infraction/infractions.py | 24 |
2 files changed, 23 insertions, 5 deletions
diff --git a/bot/exts/moderation/infraction/_scheduler.py b/bot/exts/moderation/infraction/_scheduler.py index d733c3936..a6846e239 100644 --- a/bot/exts/moderation/infraction/_scheduler.py +++ b/bot/exts/moderation/infraction/_scheduler.py @@ -394,7 +394,7 @@ class InfractionScheduler: "Reason": infraction["reason"], "Created": time.format_with_duration(infraction["inserted_at"], infraction["expires_at"]), } - + try: log.trace("Awaiting the pardon action coroutine.") returned_log = await self._pardon_action(infraction, notify) @@ -438,7 +438,7 @@ class InfractionScheduler: except ResponseCodeError: log.exception(f"Failed to fetch watch status for user {user_id}") log_text["Watching"] = "Unknown - failed to fetch watch status." - + try: # Mark infraction as inactive in the database. log.trace(f"Marking infraction #{id_} as inactive in the database.") diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py index a94da0d7c..8e5ee8200 100644 --- a/bot/exts/moderation/infraction/infractions.py +++ b/bot/exts/moderation/infraction/infractions.py @@ -330,12 +330,24 @@ class Infractions(InfractionScheduler, commands.Cog): # region: Remove infractions (un- commands) @command() - async def unmute(self, ctx: Context, user: UnambiguousMemberOrUser, *, pardon_reason: t.Optional[str] = None) -> None: + async def unmute( + self, + ctx: Context, + user: UnambiguousMemberOrUser, + *, + pardon_reason: t.Optional[str] = None + ) -> None: """Prematurely end the active mute infraction for the user.""" await self.pardon_infraction(ctx, "mute", user, pardon_reason) @command() - async def unban(self, ctx: Context, user: UnambiguousMemberOrUser, *, pardon_reason: t.Optional[str] = None) -> None: + async def unban( + self, + ctx: Context, + user: UnambiguousMemberOrUser, + *, + pardon_reason: t.Optional[str] = None + ) -> None: """Prematurely end the active ban infraction for the user.""" await self.pardon_infraction(ctx, "ban", user, pardon_reason) @@ -349,7 +361,13 @@ class Infractions(InfractionScheduler, commands.Cog): await ctx.send(":x: This command is not yet implemented. Maybe you meant to use `unvoicemute`?") @command(aliases=("uvmute",)) - async def unvoicemute(self, ctx: Context, user: UnambiguousMemberOrUser, *, pardon_reason: t.Optional[str] = None) -> None: + async def unvoicemute( + self, + ctx: Context, + user: UnambiguousMemberOrUser, + *, + pardon_reason: t.Optional[str] = None + ) -> None: """Prematurely end the active voice mute infraction for the user.""" await self.pardon_infraction(ctx, "voice_mute", user, pardon_reason) |