From 32a4739bcd9fd3ef289b0f9c8bb0b4248d9444b6 Mon Sep 17 00:00:00 2001 From: Trygve Aaberge Date: Fri, 9 Feb 2024 18:51:05 +0100 Subject: Add an option to leave the channel when a buffer is closed --- 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 8d49e55..cb4af1e 100644 --- a/slack/slack_api.py +++ b/slack/slack_api.py @@ -377,6 +377,14 @@ class SlackApi(SlackApiCommon): raise SlackApiError(self.workspace, method, response, params) return response + async def conversations_leave(self, conversation: SlackConversation): + method = "conversations.leave" + 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