diff options
Diffstat (limited to 'slack/slack_conversation.py')
-rw-r--r-- | slack/slack_conversation.py | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/slack/slack_conversation.py b/slack/slack_conversation.py index 8fb1c0e..647d0fe 100644 --- a/slack/slack_conversation.py +++ b/slack/slack_conversation.py @@ -2,7 +2,7 @@ from __future__ import annotations import time from contextlib import contextmanager -from typing import TYPE_CHECKING, Optional +from typing import TYPE_CHECKING, List, Optional import weechat @@ -37,6 +37,12 @@ class SlackConversation: self.history_filled = False self.history_pending = False + self.is_completing = False + self.completion_context = 0 + self.completion_query: Optional[str] = None + self.completion_values: List[str] = [] + self.completion_index = 0 + @property def _api(self) -> SlackApi: return self.workspace.api @@ -51,6 +57,14 @@ class SlackConversation: self.is_loading = False weechat.bar_item_update("input_text") + @contextmanager + def completing(self): + self.is_completing = True + try: + yield + finally: + self.is_completing = False + async def init(self): with self.loading(): info = await self._api.fetch_conversations_info(self) |