diff options
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} |