mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Fix unbound ParamSpec to use ... over Any
This commit is contained in:
parent
8e045d39e7
commit
eaf94e84bc
@ -191,7 +191,7 @@ class Cog(metaclass=CogMeta):
|
||||
|
||||
__cog_name__: ClassVar[str]
|
||||
__cog_settings__: ClassVar[Dict[str, Any]]
|
||||
__cog_commands__: ClassVar[List[Command[Self, Any, Any]]]
|
||||
__cog_commands__: ClassVar[List[Command[Self, ..., Any]]]
|
||||
__cog_listeners__: ClassVar[List[Tuple[str, str]]]
|
||||
|
||||
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
|
||||
@ -221,7 +221,7 @@ class Cog(metaclass=CogMeta):
|
||||
|
||||
return self
|
||||
|
||||
def get_commands(self) -> List[Command[Self, Any, Any]]:
|
||||
def get_commands(self) -> List[Command[Self, ..., Any]]:
|
||||
r"""
|
||||
Returns
|
||||
--------
|
||||
@ -249,7 +249,7 @@ class Cog(metaclass=CogMeta):
|
||||
def description(self, description: str) -> None:
|
||||
self.__cog_description__ = description
|
||||
|
||||
def walk_commands(self) -> Generator[Command[Self, Any, Any], None, None]:
|
||||
def walk_commands(self) -> Generator[Command[Self, ..., Any], None, None]:
|
||||
"""An iterator that recursively walks through this cog's commands and subcommands.
|
||||
|
||||
Yields
|
||||
|
@ -1146,12 +1146,12 @@ class GroupMixin(Generic[CogT]):
|
||||
|
||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||
case_insensitive = kwargs.get('case_insensitive', False)
|
||||
self.all_commands: Dict[str, Command[CogT, Any, Any]] = _CaseInsensitiveDict() if case_insensitive else {}
|
||||
self.all_commands: Dict[str, Command[CogT, ..., Any]] = _CaseInsensitiveDict() if case_insensitive else {}
|
||||
self.case_insensitive: bool = case_insensitive
|
||||
super().__init__(*args, **kwargs)
|
||||
|
||||
@property
|
||||
def commands(self) -> Set[Command[CogT, Any, Any]]:
|
||||
def commands(self) -> Set[Command[CogT, ..., Any]]:
|
||||
"""Set[:class:`.Command`]: A unique set of commands without aliases that are registered."""
|
||||
return set(self.all_commands.values())
|
||||
|
||||
@ -1161,7 +1161,7 @@ class GroupMixin(Generic[CogT]):
|
||||
command.recursively_remove_all_commands()
|
||||
self.remove_command(command.name)
|
||||
|
||||
def add_command(self, command: Command[CogT, Any, Any], /) -> None:
|
||||
def add_command(self, command: Command[CogT, ..., Any], /) -> None:
|
||||
"""Adds a :class:`.Command` into the internal list of commands.
|
||||
|
||||
This is usually not called, instead the :meth:`~.GroupMixin.command` or
|
||||
@ -1203,7 +1203,7 @@ class GroupMixin(Generic[CogT]):
|
||||
raise CommandRegistrationError(alias, alias_conflict=True)
|
||||
self.all_commands[alias] = command
|
||||
|
||||
def remove_command(self, name: str, /) -> Optional[Command[CogT, Any, Any]]:
|
||||
def remove_command(self, name: str, /) -> Optional[Command[CogT, ..., Any]]:
|
||||
"""Remove a :class:`.Command` from the internal list
|
||||
of commands.
|
||||
|
||||
@ -1244,7 +1244,7 @@ class GroupMixin(Generic[CogT]):
|
||||
self.all_commands[alias] = cmd
|
||||
return command
|
||||
|
||||
def walk_commands(self) -> Generator[Command[CogT, Any, Any], None, None]:
|
||||
def walk_commands(self) -> Generator[Command[CogT, ..., Any], None, None]:
|
||||
"""An iterator that recursively walks through all commands and subcommands.
|
||||
|
||||
.. versionchanged:: 1.4
|
||||
@ -1260,7 +1260,7 @@ class GroupMixin(Generic[CogT]):
|
||||
if isinstance(command, GroupMixin):
|
||||
yield from command.walk_commands()
|
||||
|
||||
def get_command(self, name: str, /) -> Optional[Command[CogT, Any, Any]]:
|
||||
def get_command(self, name: str, /) -> Optional[Command[CogT, ..., Any]]:
|
||||
"""Get a :class:`.Command` from the internal list
|
||||
of commands.
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user