mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-06-07 20:28:38 +00:00
[commands] Add tree_cls to Bot constructor
This commit is contained in:
parent
6d494585f5
commit
2d1cbacc58
@ -156,6 +156,7 @@ class BotBase(GroupMixin[None]):
|
|||||||
self,
|
self,
|
||||||
command_prefix: PrefixType[BotT],
|
command_prefix: PrefixType[BotT],
|
||||||
help_command: Optional[HelpCommand[Any]] = _default,
|
help_command: Optional[HelpCommand[Any]] = _default,
|
||||||
|
tree_cls: Type[app_commands.CommandTree] = app_commands.CommandTree,
|
||||||
description: Optional[str] = None,
|
description: Optional[str] = None,
|
||||||
**options: Any,
|
**options: Any,
|
||||||
) -> None:
|
) -> None:
|
||||||
@ -163,7 +164,7 @@ class BotBase(GroupMixin[None]):
|
|||||||
self.command_prefix: PrefixType[BotT] = command_prefix
|
self.command_prefix: PrefixType[BotT] = command_prefix
|
||||||
self.extra_events: Dict[str, List[CoroFunc]] = {}
|
self.extra_events: Dict[str, List[CoroFunc]] = {}
|
||||||
# Self doesn't have the ClientT bound, but since this is a mixin it technically does
|
# Self doesn't have the ClientT bound, but since this is a mixin it technically does
|
||||||
self.__tree: app_commands.CommandTree[Self] = app_commands.CommandTree(self) # type: ignore
|
self.__tree: app_commands.CommandTree[Self] = tree_cls(self) # type: ignore
|
||||||
self.__cogs: Dict[str, Cog] = {}
|
self.__cogs: Dict[str, Cog] = {}
|
||||||
self.__extensions: Dict[str, types.ModuleType] = {}
|
self.__extensions: Dict[str, types.ModuleType] = {}
|
||||||
self._checks: List[Check] = []
|
self._checks: List[Check] = []
|
||||||
@ -1347,6 +1348,10 @@ class Bot(BotBase, discord.Client):
|
|||||||
the ``command_prefix`` is set to ``!``. Defaults to ``False``.
|
the ``command_prefix`` is set to ``!``. Defaults to ``False``.
|
||||||
|
|
||||||
.. versionadded:: 1.7
|
.. versionadded:: 1.7
|
||||||
|
tree_cls: Type[:class:`~discord.app_commands.CommandTree`]
|
||||||
|
The type of application command tree to use. Defaults to :class:`~discord.app_commands.CommandTree`.
|
||||||
|
|
||||||
|
.. versionadded:: 2.0
|
||||||
"""
|
"""
|
||||||
|
|
||||||
pass
|
pass
|
||||||
|
Loading…
x
Reference in New Issue
Block a user