Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 3 additions & 2 deletions discord-stubs/ext/commands/core.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@ class _CheckPredicate(Protocol[_T_contra]):
def __call__(self, __ctx: _T_contra) -> Union[bool, Coroutine[Any, Any, bool]]: ...

@type_check_only
class _CheckDecorator(Protocol):
class _CheckDecorator:
predicate: _CheckPredicate[_CT]
Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

To keep _CheckDecorator so it's not generic, _CT needs to be chaned to Any here

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be reasonable to set discord.ext.commands.Context, since that will always be a Context instance?

def __call__(self, __func: _F) -> _F: ...

@type_check_only
Expand Down Expand Up @@ -275,7 +276,7 @@ def group(
case_insensitive: bool = ...,
) -> Callable[[_CoroType], Group[Any]]: ...
def check(predicate: _CheckPredicate[_CT]) -> _CheckDecorator: ...
def check_any(*checks: _CheckPredicate[_CT]) -> _CheckDecorator: ...
def check_any(*checks: _CheckDecorator) -> _CheckDecorator: ...
def has_role(item: Union[int, str]) -> _CheckDecorator: ...
def has_any_role(*items: Union[int, str]) -> _CheckDecorator: ...
def bot_has_role(item: Union[int, str]) -> _CheckDecorator: ...
Expand Down