Browse Source

[commands] Remove unused with_command HybridCommand parameter

pull/8316/head
Puncher 3 years ago
committed by GitHub
parent
commit
44abc469f1
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      discord/ext/commands/hybrid.py

8
discord/ext/commands/hybrid.py

@ -500,13 +500,9 @@ class HybridCommand(Command[CogT, P, T]):
super().__init__(func, **kwargs) super().__init__(func, **kwargs)
self.with_app_command: bool = kwargs.pop('with_app_command', True) self.with_app_command: bool = kwargs.pop('with_app_command', True)
self.with_command: bool = kwargs.pop('with_command', True)
self._locale_name: Optional[app_commands.locale_str] = name_locale self._locale_name: Optional[app_commands.locale_str] = name_locale
self._locale_description: Optional[app_commands.locale_str] = description_locale self._locale_description: Optional[app_commands.locale_str] = description_locale
if not self.with_command and not self.with_app_command:
raise TypeError('cannot set both with_command and with_app_command to False')
self.app_command: Optional[HybridAppCommand[CogT, Any, T]] = ( self.app_command: Optional[HybridAppCommand[CogT, Any, T]] = (
HybridAppCommand(self) if self.with_app_command else None HybridAppCommand(self) if self.with_app_command else None
) )
@ -872,7 +868,7 @@ def hybrid_command(
The name to create the command with. By default this uses the The name to create the command with. By default this uses the
function name unchanged. function name unchanged.
with_app_command: :class:`bool` with_app_command: :class:`bool`
Whether to register the command as an application command. Whether to register the command also as an application command.
\*\*attrs \*\*attrs
Keyword arguments to pass into the construction of the Keyword arguments to pass into the construction of the
hybrid command. hybrid command.
@ -905,7 +901,7 @@ def hybrid_group(
Parameters Parameters
----------- -----------
with_app_command: :class:`bool` with_app_command: :class:`bool`
Whether to register the command as an application command. Whether to register the command also as an application command.
Raises Raises
------- -------

Loading…
Cancel
Save