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

@@ -1745,7 +1745,7 @@ class Group:
if isinstance(command, Group):
yield from command.walk_commands()
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 a child's command raises an :exc:`AppCommandError`.
@@ -1790,10 +1790,10 @@ class Group:
if len(params) != 2:
raise TypeError('The error handler must have 2 parameters.')
self.on_error = coro # type: ignore
self.on_error = coro
return coro
async def interaction_check(self, interaction: Interaction) -> bool:
async def interaction_check(self, interaction: Interaction, /) -> bool:
"""|coro|
A callback that is called when an interaction happens within the group