aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrygve Aaberge <trygveaa@gmail.com>2024-02-19 15:48:30 +0100
committerTrygve Aaberge <trygveaa@gmail.com>2024-02-19 15:49:08 +0100
commit6b3ee1829cb6df6bc2b785e70b0674cb1f81711b (patch)
tree256568b3585e4410b02b07a74a77889abab92d69
parent24e1361628b9f3b4d94347608e3150a99021f092 (diff)
downloadwee-slack-6b3ee1829cb6df6bc2b785e70b0674cb1f81711b.tar.gz
Move set user profile functions
-rw-r--r--slack/slack_api.py28
1 files changed, 14 insertions, 14 deletions
diff --git a/slack/slack_api.py b/slack/slack_api.py
index b687416..f70e2f4 100644
--- a/slack/slack_api.py
+++ b/slack/slack_api.py
@@ -268,20 +268,6 @@ class SlackApi(SlackApiCommon):
raise SlackApiError(self.workspace, method, response, params)
return response
- async def _set_user_profile(self, profile: SlackSetProfile):
- method = "users.profile.set"
- body = {"profile": profile}
- response: SlackUsersProfileSetResponse = await self._post(method, body)
- if response["ok"] is False:
- raise SlackApiError(self.workspace, method, response, body)
- return response
-
- async def set_user_status(self, status: str):
- return await self._set_user_profile({"status_text": status})
-
- async def clear_user_status(self):
- return await self._set_user_profile({"status_emoji": "", "status_text": ""})
-
async def _fetch_users_info_without_splitting(self, user_ids: Iterable[str]):
method = "users.info"
params: Params = {"users": ",".join(user_ids)}
@@ -492,3 +478,17 @@ class SlackApi(SlackApiCommon):
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}
+ response: SlackUsersProfileSetResponse = await self._post(method, body)
+ if response["ok"] is False:
+ raise SlackApiError(self.workspace, method, response, body)
+ return response
+
+ async def set_user_status(self, status: str):
+ return await self._set_user_profile({"status_text": status})
+
+ async def clear_user_status(self):
+ return await self._set_user_profile({"status_emoji": "", "status_text": ""})