diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-19 16:24:51 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-19 21:53:32 +0100 |
commit | a2d385bbdb7d6f2c1d7c8c9bdf9548832d8965a3 (patch) | |
tree | 6bb7735b4645097eb9362f9f2b637655d9e6c945 /slack/slack_api.py | |
parent | fe49390e99caac16a47178df929332b26873ecda (diff) | |
download | wee-slack-a2d385bbdb7d6f2c1d7c8c9bdf9548832d8965a3.tar.gz |
Add command `/slack mute`
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 f70e2f4..5c6a230 100644 --- a/slack/slack_api.py +++ b/slack/slack_api.py @@ -479,6 +479,14 @@ class SlackApi(SlackApiCommon): raise SlackApiError(self.workspace, method, response, params) return response + async def set_muted_channels(self, channel_ids: Iterable[str]): + method = "users.prefs.set" + params: Params = {"name": "muted_channels", "value": ",".join(channel_ids)} + response: SlackGenericResponse = await self._fetch(method, params) + if response["ok"] is False: + raise SlackApiError(self.workspace, method, response, params) + return response + async def _set_user_profile(self, profile: SlackSetProfile): method = "users.profile.set" body = {"profile": profile} |