Skip to content

Commit

Permalink
Fix variance typing issue with CommandTree.error decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
PythonCoderAS authored Oct 14, 2024
1 parent ca85782 commit 9da131e
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions discord/app_commands/tree.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@
from .commands import ContextMenuCallback, CommandCallback, P, T

ErrorFunc = Callable[
[Interaction, AppCommandError],
[Interaction[ClientT], AppCommandError],
Coroutine[Any, Any, Any],
]

Expand Down Expand Up @@ -833,7 +833,7 @@ async def on_error(self, interaction: Interaction[ClientT], error: AppCommandErr
else:
_log.error('Ignoring exception in command tree', exc_info=error)

def error(self, coro: ErrorFunc) -> ErrorFunc:
def error(self, coro: ErrorFunc[ClientT]) -> ErrorFunc[ClientT]:
"""A decorator that registers a coroutine as a local error handler.
This must match the signature of the :meth:`on_error` callback.
Expand Down

0 comments on commit 9da131e

Please sign in to comment.