diff options
| author | 2020-10-11 12:23:02 +0300 | |
|---|---|---|
| committer | 2020-10-11 12:23:02 +0300 | |
| commit | 22e9c04d63c4a983448efc91a12335a326393e76 (patch) | |
| tree | 4667ed92470d2d87410006ebc952fce5bf39ea01 | |
| parent | Implement Voice Verifying command and delete message in voice gate (diff) | |
Suppress Voice Gate cog InWhiteListCheckFailure
| -rw-r--r-- | bot/exts/moderation/voice_gate.py | 6 |
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.""" |