mirror of
https://github.com/Rapptz/discord.py.git
synced 2025-04-19 15:36:02 +00:00
Raise error if two trees are registered to the same connection state
This commit is contained in:
parent
446bfa78b0
commit
a6ae7ec196
@ -93,6 +93,10 @@ class CommandTree(Generic[ClientT]):
|
||||
self.client: ClientT = client
|
||||
self._http = client.http
|
||||
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._guild_commands: Dict[int, Dict[str, Union[Command, Group]]] = {}
|
||||
self._global_commands: Dict[str, Union[Command, Group]] = {}
|
||||
|
Loading…
x
Reference in New Issue
Block a user