diff options
| author | pikaninja <[email protected]> | 2021-04-07 20:42:52 -0700 |
|---|---|---|
| committer | GitHub <[email protected]> | 2021-04-07 23:42:52 -0400 |
| commit | 1c553f51fb3fa1b6c713d6b17e38e0b1798e434b (patch) | |
| tree | 1a0cbd6b2baeabaef2ffcef1aa1d0d55278279d0 | |
| parent | Make the bot template use f-strings over str.format (diff) | |
| download | discord.py-1c553f51fb3fa1b6c713d6b17e38e0b1798e434b.tar.xz discord.py-1c553f51fb3fa1b6c713d6b17e38e0b1798e434b.zip | |
[commands] Use has_error_handler instead in command_error
| -rw-r--r-- | discord/ext/commands/bot.py | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/discord/ext/commands/bot.py b/discord/ext/commands/bot.py index e421f8d9..59f11c74 100644 --- a/discord/ext/commands/bot.py +++ b/discord/ext/commands/bot.py @@ -167,11 +167,12 @@ class BotBase(GroupMixin): if self.extra_events.get('on_command_error', None): return - if hasattr(context.command, 'on_error'): + command = context.command + if command and command.has_error_handler(): return cog = context.cog - if cog and Cog._get_overridden_method(cog.cog_command_error) is not None: + if cog and cog.has_error_handler(): return print(f'Ignoring exception in command {context.command}:', file=sys.stderr) |