Fix Tree.on_error still being called when a bound error handler is set

Closes #8455
This commit is contained in:
Rapptz 2022-09-24 01:22:03 -04:00
parent 6bec7e9d97
commit 6e5392c6e2

View File

@ -830,6 +830,10 @@ class Command(Generic[GroupT, P, T]):
if not hasattr(parent.parent.on_error, '__discord_app_commands_base_function__'): if not hasattr(parent.parent.on_error, '__discord_app_commands_base_function__'):
return True return True
# Check if we have a bound error handler
if hasattr(self.binding, '__discord_app_commands_error_handler__'):
return True
return False return False
async def _transform_arguments(self, interaction: Interaction, namespace: Namespace) -> Dict[str, Any]: async def _transform_arguments(self, interaction: Interaction, namespace: Namespace) -> Dict[str, Any]: