diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-14 12:38:25 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 2e64309e8094fe7409a0d97d32dfe8d35fed689c (patch) | |
tree | 3a5005daa653ff907b6c72b7a43666082f4bd86c /slack | |
parent | 570f855c7aa29168e2c883066e4b878068646caf (diff) | |
download | wee-slack-2e64309e8094fe7409a0d97d32dfe8d35fed689c.tar.gz |
Add typings for users.conversations
Diffstat (limited to 'slack')
-rw-r--r-- | slack/slack_api.py | 3 | ||||
-rw-r--r-- | slack/slack_workspace.py | 4 |
2 files changed, 6 insertions, 1 deletions
diff --git a/slack/slack_api.py b/slack/slack_api.py index 4d8df43..aeaf6be 100644 --- a/slack/slack_api.py +++ b/slack/slack_api.py @@ -9,6 +9,7 @@ from slack.shared import shared if TYPE_CHECKING: from slack_api.slack_conversations_info import SlackConversationsInfoResponse + from slack_api.slack_users_conversations import SlackUsersConversationsResponse from slack.slack_conversation import SlackConversation from slack.slack_user import SlackUser @@ -65,7 +66,7 @@ class SlackApi: exclude_archived: bool = True, limit: int = 1000, pages: int = -1, - ) -> Any: + ) -> SlackUsersConversationsResponse: return await self._fetch_list( "users.conversations", "channels", diff --git a/slack/slack_workspace.py b/slack/slack_workspace.py index 72ffc7d..e659eba 100644 --- a/slack/slack_workspace.py +++ b/slack/slack_workspace.py @@ -42,6 +42,10 @@ class SlackWorkspace: user_channels_response = await self.api.fetch_users_conversations( "public_channel" ) + if user_channels_response["ok"] is False: + # TODO: Handle error + return + user_channels = user_channels_response["channels"] for channel in user_channels: |