[commands] Use has_error_handler instead in command_error

This commit is contained in:
pikaninja 2021-04-07 20:42:52 -07:00 committed by GitHub
parent cc6edccc0c
commit 1c553f51fb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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)