aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar ks129 <[email protected]>2020-10-11 12:23:02 +0300
committerGravatar ks129 <[email protected]>2020-10-11 12:23:02 +0300
commit22e9c04d63c4a983448efc91a12335a326393e76 (patch)
tree4667ed92470d2d87410006ebc952fce5bf39ea01
parentImplement Voice Verifying command and delete message in voice gate (diff)
Suppress Voice Gate cog InWhiteListCheckFailure
-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."""