From 32726057a91556dd666eef872e69bd621e6fd253 Mon Sep 17 00:00:00 2001 From: Shivansh Date: Fri, 7 May 2021 09:44:45 +0530 Subject: (infractions): Apply temporary voice ban if duration specified by while voice banning user --- bot/exts/moderation/infraction/infractions.py | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py index bf66d5bba..de3367661 100644 --- a/bot/exts/moderation/infraction/infractions.py +++ b/bot/exts/moderation/infraction/infractions.py @@ -108,9 +108,20 @@ class Infractions(InfractionScheduler, commands.Cog): 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: - """Permanently ban user from using voice channels.""" - await self.apply_voice_ban(ctx, user, reason) + async def voiceban( + self, + ctx: Context, + user: FetchedMember, + duration: t.Optional[Expiry] = None, + *, + reason: t.Optional[str] + ) -> None: + """ + Permanently ban user from using voice channels. + + If duration is specified, then it would temporarily voice ban that user for the given duration. + """ + await self.apply_voice_ban(ctx, user, reason, expires_at=duration) # endregion # region: Temporary infractions -- cgit v1.2.3