Skip to content

Commit

Permalink
feat: PartialUserに_get_mentionプロパティを追加
Browse files Browse the repository at this point in the history
  • Loading branch information
yupix committed Feb 21, 2024
1 parent 1675f52 commit 0e8f8b4
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions mipac/models/lite/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -297,6 +297,17 @@ def api(self) -> ClientUserManager:
"""
return self._client._create_client_user_manager(self)

@property
def _get_mention(self) -> str: # TODO: モデルに移す
"""対象のユーザーのメンションを取得します
Returns
-------
str
メンション
"""
return f"@{self.username}@{self.host}" if self.instance else f"@{self.username}"

def _get(self, key: str) -> Any | None:
return self._raw_user.get(key)

Expand Down

0 comments on commit 0e8f8b4

Please sign in to comment.