aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Shivansh <[email protected]>2021-05-07 09:42:49 +0530
committerGravatar Shivansh <[email protected]>2021-05-07 09:42:49 +0530
commit9c3ef7cca753387fd7ae7618430a6059839f3df8 (patch)
tree4d2703a36386d74f2ead5c87bb9efbe008947dba
parent(infractions): Apply tempban if duration is specified while banning a user (diff)
(infractions): Remove purge days & add duration argument for pban
-rw-r--r--bot/exts/moderation/infraction/infractions.py9
1 files 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: