diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-09 18:51:05 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 13:01:40 +0100 |
commit | 32a4739bcd9fd3ef289b0f9c8bb0b4248d9444b6 (patch) | |
tree | a35af16926b13190391c821d32944593b91e7628 /slack/slack_api.py | |
parent | 1b495a4b9ab7742c50de247efa9101b1eac08ef7 (diff) | |
download | wee-slack-32a4739bcd9fd3ef289b0f9c8bb0b4248d9444b6.tar.gz |
Add an option to leave the channel when a buffer is closed
Diffstat (limited to 'slack/slack_api.py')
-rw-r--r-- | slack/slack_api.py | 8 |
1 files changed, 8 insertions, 0 deletions
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} |