Skip to content

Commit

Permalink
Add a py 3.10 overload to command decorator
Browse files Browse the repository at this point in the history
  • Loading branch information
Dorukyum committed Jul 4, 2022
1 parent 6800b57 commit 4cf035b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions discord/ext/commands/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -1598,6 +1598,23 @@ async def reinvoke(self, ctx: Context, *, call_hooks: bool = False) -> None:
# Decorators


@overload # for py 3.10
def command(
name: str = ...,
cls: Type[Command[CogT, P, T]] = ...,
**attrs: Any,
) -> Callable[
[
Union[
Callable[Concatenate[CogT, ContextT, P]], Coro[T],
Callable[Concatenate[ContextT, P]], Coro[T],
]
],
Command[CogT, P, T],
]:
...


@overload
def command(
name: str = ...,
Expand Down

0 comments on commit 4cf035b

Please sign in to comment.