diff options
Diffstat (limited to 'slack')
-rw-r--r-- | slack/slack_api.py | 3 | ||||
-rw-r--r-- | slack/slack_user.py | 3 |
2 files changed, 5 insertions, 1 deletions
diff --git a/slack/slack_api.py b/slack/slack_api.py index aeaf6be..ef522d0 100644 --- a/slack/slack_api.py +++ b/slack/slack_api.py @@ -10,6 +10,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_api.slack_users_info import SlackUsersInfoResponse from slack.slack_conversation import SlackConversation from slack.slack_user import SlackUser @@ -78,5 +79,5 @@ class SlackApi: pages, ) - async def fetch_users_info(self, user: SlackUser) -> Any: + async def fetch_users_info(self, user: SlackUser) -> SlackUsersInfoResponse: return await self._fetch("users.info", {"user": user.id}) diff --git a/slack/slack_user.py b/slack/slack_user.py index 18c897f..6cb3897 100644 --- a/slack/slack_user.py +++ b/slack/slack_user.py @@ -18,4 +18,7 @@ class SlackUser: async def init(self): info = await self.api.fetch_users_info(self) + if info["ok"] is False: + # TODO: Handle error + return self.name = info["user"]["name"] |