aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorpikaninja <[email protected]>2021-04-07 20:42:52 -0700
committerGitHub <[email protected]>2021-04-07 23:42:52 -0400
commit1c553f51fb3fa1b6c713d6b17e38e0b1798e434b (patch)
tree1a0cbd6b2baeabaef2ffcef1aa1d0d55278279d0
parentMake the bot template use f-strings over str.format (diff)
downloaddiscord.py-1c553f51fb3fa1b6c713d6b17e38e0b1798e434b.tar.xz
discord.py-1c553f51fb3fa1b6c713d6b17e38e0b1798e434b.zip
[commands] Use has_error_handler instead in command_error
-rw-r--r--discord/ext/commands/bot.py5
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)