mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-08 04:38:42 +00:00
Fix variance typing issue with CommandTree.error decorator
This commit is contained in:
parent
ca85782b35
commit
9da131ed26
@ -73,7 +73,7 @@ if TYPE_CHECKING:
|
|||||||
from .commands import ContextMenuCallback, CommandCallback, P, T
|
from .commands import ContextMenuCallback, CommandCallback, P, T
|
||||||
|
|
||||||
ErrorFunc = Callable[
|
ErrorFunc = Callable[
|
||||||
[Interaction, AppCommandError],
|
[Interaction[ClientT], AppCommandError],
|
||||||
Coroutine[Any, Any, Any],
|
Coroutine[Any, Any, Any],
|
||||||
]
|
]
|
||||||
|
|
||||||
@ -833,7 +833,7 @@ class CommandTree(Generic[ClientT]):
|
|||||||
else:
|
else:
|
||||||
_log.error('Ignoring exception in command tree', exc_info=error)
|
_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.
|
"""A decorator that registers a coroutine as a local error handler.
|
||||||
|
|
||||||
This must match the signature of the :meth:`on_error` callback.
|
This must match the signature of the :meth:`on_error` callback.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user