From 09d4f4822ea5e3f97a7af5ba1e053f8001d80b5f Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Tue, 31 Jan 2023 23:37:40 +0100 Subject: Don't allow /slack (dis)connect when connecting/(dis)connected --- slack/slack_workspace.py | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'slack/slack_workspace.py') diff --git a/slack/slack_workspace.py b/slack/slack_workspace.py index bc31a27..57cd57c 100644 --- a/slack/slack_workspace.py +++ b/slack/slack_workspace.py @@ -175,6 +175,10 @@ class SlackWorkspace: def is_connected(self): return self._is_connected + @property + def is_connecting(self): + return self._connect_task is not None + @is_connected.setter def is_connected(self, value: bool): self._is_connected = value @@ -183,6 +187,7 @@ class SlackWorkspace: async def connect(self) -> None: self._connect_task = create_task(self._connect()) await self._connect_task + self._connect_task = None async def _connect(self) -> None: rtm_connect = await self.api.fetch_rtm_connect() -- cgit