2
0
mirror of https://github.com/pyrogram/pyrogram synced 2025-08-28 21:07:59 +00:00

Clean User type

This commit is contained in:
Dan 2018-04-23 19:00:20 +02:00
parent 730d5e74f0
commit b8473c9f7f

View File

@ -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 <pyrogram.types.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