From 9c3ef7cca753387fd7ae7618430a6059839f3df8 Mon Sep 17 00:00:00 2001 From: Shivansh Date: Fri, 7 May 2021 09:42:49 +0530 Subject: (infractions): Remove purge days & add duration argument for pban --- bot/exts/moderation/infraction/infractions.py | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py index 2d72a3db4..bf66d5bba 100644 --- a/bot/exts/moderation/infraction/infractions.py +++ b/bot/exts/moderation/infraction/infractions.py @@ -96,17 +96,16 @@ class Infractions(InfractionScheduler, commands.Cog): self, ctx: Context, user: FetchedMember, - purge_days: t.Optional[int] = 1, + duration: t.Optional[Expiry] = None, *, reason: t.Optional[str] = None ) -> None: """ - Same as ban but removes all their messages for the given number of days, default being 1. + Same as ban but removes all their messages of the current day. - `purge_days` can only be values between 0 and 7. - Anything outside these bounds are automatically adjusted to their respective limits. + If duration is specified, then it would temporarily ban that user for the given duration. """ - await self.apply_ban(ctx, user, reason, max(min(purge_days, 7), 0)) + await self.apply_ban(ctx, user, reason, 1, 0, expires_at=duration) @command(aliases=('vban',)) async def voiceban(self, ctx: Context, user: FetchedMember, *, reason: t.Optional[str]) -> None: -- cgit v1.2.3