aboutsummaryrefslogtreecommitdiffstats
path: root/slack/slack_api.py
diff options
context:
space:
mode:
authorPier <pierg75@yahoo.it>2024-02-18 10:54:01 +0000
committerGitHub <noreply@github.com>2024-02-18 11:54:01 +0100
commit0531090db0976b1261a033dd2eabd4c641a91d2c (patch)
tree270a8a13c683260d81a7b27f17f7a61068be59aa /slack/slack_api.py
parent1989a394e96df843a1e5d852e9706cafcf6c0945 (diff)
downloadwee-slack-0531090db0976b1261a033dd2eabd4c641a91d2c.tar.gz
Set user user presence (#919)
The user can now set the presence with: /slack presence away Or: /slack presence active Signed-off-by: Pierguido Lambri <plambri@redhat.com>
Diffstat (limited to 'slack/slack_api.py')
-rw-r--r--slack/slack_api.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/slack/slack_api.py b/slack/slack_api.py
index 2f57e61..e71860b 100644
--- a/slack/slack_api.py
+++ b/slack/slack_api.py
@@ -412,3 +412,11 @@ class SlackApi(SlackApiCommon):
if response["ok"] is False:
raise SlackApiError(self.workspace, method, response, params)
return response
+
+ async def set_presence(self, presence: Literal["active", "away"]):
+ method = "presence.set"
+ params: Params = {"presence": presence}
+ response: SlackGenericResponse = await self._fetch(method, params)
+ if response["ok"] is False:
+ raise SlackApiError(self.workspace, method, response, params)
+ return response