From 84c0c20bd5bf04b89384691d90c9ef7f2a41ca0c Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Thu, 19 Oct 2023 22:43:01 +0200 Subject: Close IM/MPIM and remove from open_conversations on buffer close --- slack/slack_api.py | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'slack/slack_api.py') diff --git a/slack/slack_api.py b/slack/slack_api.py index 2264e36..c82fc5b 100644 --- a/slack/slack_api.py +++ b/slack/slack_api.py @@ -276,6 +276,14 @@ class SlackApi(SlackApiCommon): raise SlackApiError(self.workspace, method, response) return response + async def conversations_close(self, conversation: SlackConversation): + method = "conversations.close" + params: Params = {"channel": conversation.id} + response: SlackGenericResponse = await self._fetch(method, params) + if response["ok"] is False: + raise SlackApiError(self.workspace, method, response, params) + return response + async def conversations_mark(self, conversation: SlackConversation, ts: SlackTs): method = "conversations.mark" params: Params = {"channel": conversation.id, "ts": ts} -- cgit