diff options
author | Trygve Aaberge <trygveaa@gmail.com> | 2023-01-28 20:38:18 +0100 |
---|---|---|
committer | Trygve Aaberge <trygveaa@gmail.com> | 2024-02-18 11:32:53 +0100 |
commit | b7a3eb918171ac2049dda68c1c1dda19a1319162 (patch) | |
tree | d465421cfe340060aa9d68b5d9369fb9eaacb5fa /slack/slack_user.py | |
parent | a4e5f0612c09b337b85a83a18cf9127c6f814739 (diff) | |
download | wee-slack-b7a3eb918171ac2049dda68c1c1dda19a1319162.tar.gz |
Remove unnecessary id parameters
Diffstat (limited to 'slack/slack_user.py')
-rw-r--r-- | slack/slack_user.py | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/slack/slack_user.py b/slack/slack_user.py index 871c1ef..c2e4b23 100644 --- a/slack/slack_user.py +++ b/slack/slack_user.py @@ -43,15 +43,14 @@ def format_bot_nick(nick: str, colorize: bool = False) -> str: class SlackUser: - def __init__(self, workspace: SlackWorkspace, id: str, info: SlackUserInfo): + def __init__(self, workspace: SlackWorkspace, info: SlackUserInfo): self.workspace = workspace - self.id = id self._info = info @classmethod async def create(cls, workspace: SlackWorkspace, id: str): info_response = await workspace.api.fetch_user_info(id) - return cls(workspace, id, info_response["user"]) + return cls(workspace, info_response["user"]) @property def _api(self) -> SlackApi: @@ -72,7 +71,7 @@ class SlackUser: return name_from_user_info_without_spaces(self.workspace, self._info) def _nick_color(self) -> str: - if self.id == self.workspace.my_user.id: + if self._info["id"] == self.workspace.my_user._info["id"]: return weechat.config_string( weechat.config_get("weechat.color.chat_nick_self") ) @@ -81,15 +80,14 @@ class SlackUser: class SlackBot: - def __init__(self, workspace: SlackWorkspace, id: str, info: SlackBotInfo): + def __init__(self, workspace: SlackWorkspace, info: SlackBotInfo): self.workspace = workspace - self.id = id self._info = info @classmethod async def create(cls, workspace: SlackWorkspace, id: str): info_response = await workspace.api.fetch_bot_info(id) - return cls(workspace, id, info_response["bot"]) + return cls(workspace, info_response["bot"]) @property def _api(self) -> SlackApi: |