Browse Source

Fix signature detection in CommandTree.error decorator

pull/7888/head
Rapptz 3 years ago
parent
commit
cdf442bc32
  1. 4
      discord/app_commands/tree.py

4
discord/app_commands/tree.py

@ -773,8 +773,8 @@ class CommandTree(Generic[ClientT]):
raise TypeError('The error handler must be a coroutine.')
params = inspect.signature(coro).parameters
if len(params) != 3:
raise TypeError('error handler must have 3 parameters')
if len(params) != 2:
raise TypeError('error handler must have 2 parameters')
# Type checker doesn't like overriding methods like this
self.on_error = coro # type: ignore

Loading…
Cancel
Save