Skip to content

Commit

Permalink
fix: Restore overriding on_application_command_error via listener (#2044
Browse files Browse the repository at this point in the history
)

* Restore app command error listener overwrite

* Update CHANGELOG.md

* style(pre-commit): auto fixes from pre-commit.com hooks

---------

Signed-off-by: UK <41271523+NeloBlivion@users.noreply.github.com>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Lala Sabathil <lala@pycord.dev>
  • Loading branch information
3 people committed May 7, 2023
1 parent 2abfa34 commit d519e95
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions CHANGELOG.md
Expand Up @@ -93,6 +93,8 @@ These changes are available on the `master` branch, but have not yet been releas
([#2029](https://github.com/Pycord-Development/pycord/pull/2029))
- Reflecting the api for gettings bans correctly.
([#1922](https://github.com/Pycord-Development/pycord/pull/1922))
- Restored functionality for overriding default `on_application_command_error` via
listeners. ([#2044](https://github.com/Pycord-Development/pycord/pull/2044))
- Fixed unloading of cogs having bridge commands.
([#2048](https://github.com/Pycord-Development/pycord/pull/2048))

Expand Down
2 changes: 2 additions & 0 deletions discord/bot.py
Expand Up @@ -1177,6 +1177,8 @@ async def on_application_command_error(
This only fires if you do not specify any listeners for command error.
"""
if self._event_handlers.get("on_application_command_error", None):
return
command = context.command
if command and command.has_error_handler():
return
Expand Down

0 comments on commit d519e95

Please sign in to comment.