mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-07-04 01:00:00 +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_name__: ClassVar[str]
|
||||||
__cog_settings__: ClassVar[Dict[str, Any]]
|
__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]]]
|
__cog_listeners__: ClassVar[List[Tuple[str, str]]]
|
||||||
|
|
||||||
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
|
def __new__(cls, *args: Any, **kwargs: Any) -> Self:
|
||||||
@ -221,7 +221,7 @@ class Cog(metaclass=CogMeta):
|
|||||||
|
|
||||||
return self
|
return self
|
||||||
|
|
||||||
def get_commands(self) -> List[Command[Self, Any, Any]]:
|
def get_commands(self) -> List[Command[Self, ..., Any]]:
|
||||||
r"""
|
r"""
|
||||||
Returns
|
Returns
|
||||||
--------
|
--------
|
||||||
@ -249,7 +249,7 @@ class Cog(metaclass=CogMeta):
|
|||||||
def description(self, description: str) -> None:
|
def description(self, description: str) -> None:
|
||||||
self.__cog_description__ = description
|
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.
|
"""An iterator that recursively walks through this cog's commands and subcommands.
|
||||||
|
|
||||||
Yields
|
Yields
|
||||||
|
@ -1146,12 +1146,12 @@ class GroupMixin(Generic[CogT]):
|
|||||||
|
|
||||||
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
def __init__(self, *args: Any, **kwargs: Any) -> None:
|
||||||
case_insensitive = kwargs.get('case_insensitive', False)
|
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
|
self.case_insensitive: bool = case_insensitive
|
||||||
super().__init__(*args, **kwargs)
|
super().__init__(*args, **kwargs)
|
||||||
|
|
||||||
@property
|
@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."""
|
"""Set[:class:`.Command`]: A unique set of commands without aliases that are registered."""
|
||||||
return set(self.all_commands.values())
|
return set(self.all_commands.values())
|
||||||
|
|
||||||
@ -1161,7 +1161,7 @@ class GroupMixin(Generic[CogT]):
|
|||||||
command.recursively_remove_all_commands()
|
command.recursively_remove_all_commands()
|
||||||
self.remove_command(command.name)
|
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.
|
"""Adds a :class:`.Command` into the internal list of commands.
|
||||||
|
|
||||||
This is usually not called, instead the :meth:`~.GroupMixin.command` or
|
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)
|
raise CommandRegistrationError(alias, alias_conflict=True)
|
||||||
self.all_commands[alias] = command
|
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
|
"""Remove a :class:`.Command` from the internal list
|
||||||
of commands.
|
of commands.
|
||||||
|
|
||||||
@ -1244,7 +1244,7 @@ class GroupMixin(Generic[CogT]):
|
|||||||
self.all_commands[alias] = cmd
|
self.all_commands[alias] = cmd
|
||||||
return command
|
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.
|
"""An iterator that recursively walks through all commands and subcommands.
|
||||||
|
|
||||||
.. versionchanged:: 1.4
|
.. versionchanged:: 1.4
|
||||||
@ -1260,7 +1260,7 @@ class GroupMixin(Generic[CogT]):
|
|||||||
if isinstance(command, GroupMixin):
|
if isinstance(command, GroupMixin):
|
||||||
yield from command.walk_commands()
|
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
|
"""Get a :class:`.Command` from the internal list
|
||||||
of commands.
|
of commands.
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user