mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-18 23:15:48 +00:00
Fix signature detection in CommandTree.error decorator
This commit is contained in:
parent
3f4fb91328
commit
cdf442bc32
@ -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…
x
Reference in New Issue
Block a user