diff options
| author | 2020-10-11 14:01:32 +0300 | |
|---|---|---|
| committer | 2020-10-11 14:01:32 +0300 | |
| commit | 55a46c937de9c27cd865ff34cfe82c8fb76dc603 (patch) | |
| tree | 3887fa416741128f2abad0389329cb8bc10bc1d9 | |
| parent | Create 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.py | 3 |
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) |