From b8473c9f7fee0660f729cb1779fef6a01f0f2f04 Mon Sep 17 00:00:00 2001 From: Dan <14043624+delivrance@users.noreply.github.com> Date: Mon, 23 Apr 2018 19:00:20 +0200 Subject: [PATCH] Clean User type --- pyrogram/client/types/user.py | 31 ++++++++++++++++++++++++------- 1 file changed, 24 insertions(+), 7 deletions(-) diff --git a/pyrogram/client/types/user.py b/pyrogram/client/types/user.py index f7734fcc..928b3f31 100644 --- a/pyrogram/client/types/user.py +++ b/pyrogram/client/types/user.py @@ -44,13 +44,30 @@ class User(Object): language_code (``str``, optional): IETF language tag of the user's language. + phone_number (``str``, optional): + User's or bot's phone number. + + photo (obj:`ChatPhoto `, optional): + User's or bot's current profile photo. """ ID = 0xb0700001 - def __init__(self, id, is_bot, first_name, last_name=None, username=None, language_code=None): - self.id = id # int - self.is_bot = is_bot # Bool - self.first_name = first_name # string - self.last_name = last_name # flags.0?string - self.username = username # flags.1?string - self.language_code = language_code # flags.2?string + def __init__( + self, + id: int, + is_bot: bool, + first_name: str, + last_name: str = None, + username: str = None, + language_code: str = None, + phone_number: str = None, + photo=None + ): + self.id = id + self.is_bot = is_bot + self.first_name = first_name + self.last_name = last_name + self.username = username + self.language_code = language_code + self.phone_number = phone_number + self.photo = photo