aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-10-11 14:01:32 +0300
committerGravatar ks129 <[email protected]>2020-10-11 14:01:32 +0300
commit55a46c937de9c27cd865ff34cfe82c8fb76dc603 (patch)
tree3887fa416741128f2abad0389329cb8bc10bc1d9
parentCreate test for case when trying to voice ban user who haven't passed gate (diff)
Simplify post infraction calling and None check
-rw-r--r--bot/exts/moderation/infraction/infractions.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/bot/exts/moderation/infraction/infractions.py b/bot/exts/moderation/infraction/infractions.py
index 2157c040c..6a6250238 100644
--- a/bot/exts/moderation/infraction/infractions.py
+++ b/bot/exts/moderation/infraction/infractions.py
@@ -366,8 +366,7 @@ class Infractions(InfractionScheduler, commands.Cog):
if await _utils.get_active_infraction(ctx, user, "voice_ban"):
return
- infraction = await _utils.post_infraction(ctx, user, "voice_ban", reason, active=True, **kwargs)
- if infraction is None:
+ if infraction := await _utils.post_infraction(ctx, user, "voice_ban", reason, active=True, **kwargs):
return
self.mod_log.ignore(Event.member_update, user.id)