diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-14 22:24:44 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | 1906b75a92fcdc441e891546cc9cc97a2e621495 (patch) | |
tree | 15ed1ef3a8d80b972a3fb4c3e490574b50d24c3c /slack/slack_user.py | |
parent | a703cb532e9ed7ac404f48fa292903f392484805 (diff) | |
download | wee-slack-1906b75a92fcdc441e891546cc9cc97a2e621495.tar.gz |
Some cleanup and make some properties private
Diffstat (limited to 'slack/slack_user.py')
-rw-r--r-- | slack/slack_user.py | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/slack/slack_user.py b/slack/slack_user.py index 4386657..8fcd445 100644 --- a/slack/slack_user.py +++ b/slack/slack_user.py @@ -10,15 +10,18 @@ class SlackUser: def __init__(self, workspace: SlackWorkspace, id: str): self.workspace = workspace self.id = id - self.name: str @property - def api(self) -> SlackApi: + def _api(self) -> SlackApi: return self.workspace.api + @property + def nick(self): + return self._info["name"] + async def init(self): - info = await self.api.fetch_users_info(self) + info = await self._api.fetch_users_info(self) if info["ok"] is False: # TODO: Handle error raise Exception("Failed fetching user info") - self.name = info["user"]["name"] + self._info = info["user"] |