aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--bot/exts/moderation/voice_gate.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/bot/exts/moderation/voice_gate.py b/bot/exts/moderation/voice_gate.py
index dae19d49e..101db90b8 100644
--- a/bot/exts/moderation/voice_gate.py
+++ b/bot/exts/moderation/voice_gate.py
@@ -12,6 +12,7 @@ from bot.bot import Bot
from bot.constants import Channels, Roles, VoiceGate as VoiceGateConf, MODERATION_ROLES, Event
from bot.decorators import has_no_roles, in_whitelist
from bot.exts.moderation.modlog import ModLog
+from bot.utils.checks import InWhitelistCheckFailure
log = logging.getLogger(__name__)
@@ -119,6 +120,11 @@ class VoiceGate(Cog):
with suppress(discord.NotFound):
await message.delete()
+ async def cog_command_error(self, ctx: Context, error: Exception) -> None:
+ """Check for & ignore any InWhitelistCheckFailure."""
+ if isinstance(error, InWhitelistCheckFailure):
+ error.handled = True
+
def setup(bot: Bot) -> None:
"""Loads the VoiceGate cog."""