mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-12-08 08:22:19 +00:00
Raise error if two trees are registered to the same connection state
This commit is contained in:
@@ -93,6 +93,10 @@ class CommandTree(Generic[ClientT]):
|
|||||||
self.client: ClientT = client
|
self.client: ClientT = client
|
||||||
self._http = client.http
|
self._http = client.http
|
||||||
self._state = client._connection
|
self._state = client._connection
|
||||||
|
|
||||||
|
if self._state._command_tree is not None:
|
||||||
|
raise ClientException('This client already has an associated command tree.')
|
||||||
|
|
||||||
self._state._command_tree = self
|
self._state._command_tree = self
|
||||||
self._guild_commands: Dict[int, Dict[str, Union[Command, Group]]] = {}
|
self._guild_commands: Dict[int, Dict[str, Union[Command, Group]]] = {}
|
||||||
self._global_commands: Dict[str, Union[Command, Group]] = {}
|
self._global_commands: Dict[str, Union[Command, Group]] = {}
|
||||||
|
|||||||
Reference in New Issue
Block a user