Skip to content

Commit 9da131e

Browse files
Fix variance typing issue with CommandTree.error decorator
1 parent ca85782 commit 9da131e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

discord/app_commands/tree.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@
7373
from .commands import ContextMenuCallback, CommandCallback, P, T
7474

7575
ErrorFunc = Callable[
76-
[Interaction, AppCommandError],
76+
[Interaction[ClientT], AppCommandError],
7777
Coroutine[Any, Any, Any],
7878
]
7979

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

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

0 commit comments

Comments
 (0)