From 054c9c71097389b92d9f0e9545ad3997a98d530d Mon Sep 17 00:00:00 2001 From: Rapptz Date: Wed, 13 Apr 2016 14:25:45 -0400 Subject: [PATCH] [commands] CommandError derived exceptions in checks don't crash help. --- discord/ext/commands/formatter.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/discord/ext/commands/formatter.py b/discord/ext/commands/formatter.py index 5240ffd27..2339a90f2 100644 --- a/discord/ext/commands/formatter.py +++ b/discord/ext/commands/formatter.py @@ -28,6 +28,7 @@ import itertools import inspect from .core import GroupMixin, Command +from .errors import CommandError # help -> shows info of bot on top/bottom and lists subcommands # help command -> shows detailed info of command @@ -193,7 +194,10 @@ class HelpFormatter: # care about them, so just return true. return True - return cmd.can_run(self.context) + try: + return cmd.can_run(self.context) + except CommandError: + return False iterator = self.command.commands.items() if not self.is_cog() else self.context.bot.commands.items() return filter(predicate, iterator)