Skip to content

Commit

Permalink
πŸŽ‰ Add ability to get user's phone number (uriyyo#69)
Browse files Browse the repository at this point in the history
  • Loading branch information
opastushkov committed Jan 17, 2021
1 parent 337fed5 commit 37b53f1
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions instapi/models/user.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,18 @@ def media_count(self) -> int:
"""
return cast(int, self.user_detail()["media_count"])

@property
def get_phone_number(self) -> str:
"""
Return user's phone number
:return: str
"""
detail = self.user_detail()
phone_number = detail["public_phone_country_code"] + detail["public_phone_number"]

return "+{}".format(phone_number) if phone_number else ""

@property
def follower_count(self) -> int:
"""
Expand Down

0 comments on commit 37b53f1

Please sign in to comment.