Mark public callbacks as positional-only

This commit is contained in:
Bryan Forbes
2022-08-22 14:21:19 -05:00
committed by GitHub
parent 01bb7ecb79
commit b12b4b18fd
6 changed files with 23 additions and 24 deletions

View File

@ -773,7 +773,7 @@ class CommandTree(Generic[ClientT]):
for key in remove:
del mapping[key]
async def on_error(self, interaction: Interaction, error: AppCommandError) -> None:
async def on_error(self, interaction: Interaction, error: AppCommandError, /) -> None:
"""|coro|
A callback that is called when any command raises an :exc:`AppCommandError`.
@ -827,8 +827,7 @@ class CommandTree(Generic[ClientT]):
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
self.on_error = coro
return coro
def command(