User

class pyrogram.raw.base.User

Object defines a user.

Constructors:

This base type has 2 constructors available.

User

Indicates info about a certain user.

UserEmpty

Empty constructor, non-existent user.

Functions:

This object can be returned by 8 functions.

account.UpdateProfile

Updates user profile.

account.UpdateUsername

Changes username for the current user.

account.ChangePhone

Change the phone number of the current account

users.GetUsers

Returns basic user info according to their identifiers.

contacts.ImportContactToken

Obtain user info from a temporary profile link.

messages.GetFutureChatCreatorAfterLeave

Telegram API function.

channels.GetMessageAuthor

Can only be invoked by non-bot admins of a monoforum », obtains the original sender of a message sent by other monoforum admins to the monoforum, on behalf of the channel associated to the monoforum.

bots.GetAdminedBots

Get a list of bots owned by the current user

TL Schema

user#31774388
flags:#
self:flags.10?true
contact:flags.11?true
mutual_contact:flags.12?true
deleted:flags.13?true
bot:flags.14?true
bot_chat_history:flags.15?true
bot_nochats:flags.16?true
verified:flags.17?true
restricted:flags.18?true
min:flags.20?true
bot_inline_geo:flags.21?true
support:flags.23?true
scam:flags.24?true
apply_min_photo:flags.25?true
fake:flags.26?true
bot_attach_menu:flags.27?true
premium:flags.28?true
attach_menu_enabled:flags.29?true
flags2:#
bot_can_edit:flags2.1?true
close_friend:flags2.2?true
stories_hidden:flags2.3?true
stories_unavailable:flags2.4?true
contact_require_premium:flags2.10?true
bot_business:flags2.11?true
bot_has_main_app:flags2.13?true
bot_forum_view:flags2.16?true
bot_forum_can_manage_topics:flags2.17?true
id:long
access_hash:flags.0?long
first_name:flags.1?string
last_name:flags.2?string
username:flags.3?string
phone:flags.4?string
photo:flags.5?UserProfilePhoto
status:flags.6?UserStatus
bot_info_version:flags.14?int
restriction_reason:flags.18?Vector<RestrictionReason>
bot_inline_placeholder:flags.19?string
lang_code:flags.22?string
emoji_status:flags.30?EmojiStatus
usernames:flags2.0?Vector<Username>
stories_max_id:flags2.5?RecentStory
color:flags2.8?PeerColor
profile_color:flags2.9?PeerColor
bot_active_users:flags2.12?int
bot_verification_icon:flags2.14?long
send_paid_messages_stars:flags2.15?long

= User

Parameter Tree

User
├── is_selftrue (optional)
├── contacttrue (optional)
├── mutual_contacttrue (optional)
├── deletedtrue (optional)
├── bottrue (optional)
├── bot_chat_historytrue (optional)
├── bot_nochatstrue (optional)
├── verifiedtrue (optional)
├── restrictedtrue (optional)
├── mintrue (optional)
├── bot_inline_geotrue (optional)
├── supporttrue (optional)
├── scamtrue (optional)
├── apply_min_phototrue (optional)
├── faketrue (optional)
├── bot_attach_menutrue (optional)
├── premiumtrue (optional)
├── attach_menu_enabledtrue (optional)
├── bot_can_edittrue (optional)
├── close_friendtrue (optional)
├── stories_hiddentrue (optional)
├── stories_unavailabletrue (optional)
├── contact_require_premiumtrue (optional)
├── bot_businesstrue (optional)
├── bot_has_main_apptrue (optional)
├── bot_forum_viewtrue (optional)
├── bot_forum_can_manage_topicstrue (optional)
├── idlong
├── access_hashlong (optional)
├── first_namestring (optional)
├── last_namestring (optional)
├── usernamestring (optional)
├── phonestring (optional)
├── photoUserProfilePhoto (optional)
│ ├── UserProfilePhotoEmpty
│ └── UserProfilePhoto
│ ├── has_videotrue (optional)
│ ├── personaltrue (optional)
│ ├── photo_idlong
│ ├── stripped_thumbbytes (optional)
│ └── dc_idint
├── statusUserStatus (optional)
│ ├── UserStatusEmpty
│ ├── UserStatusOnline
│ │ └── expiresint
│ ├── UserStatusOffline
│ │ └── was_onlineint
│ ├── UserStatusRecently
│ │ └── by_metrue (optional)
│ ├── UserStatusLastWeek
│ │ └── by_metrue (optional)
│ └── UserStatusLastMonth
│ └── by_metrue (optional)
├── bot_info_versionint (optional)
├── restriction_reasonVector < RestrictionReason > (optional)
│ └── RestrictionReason
│ ├── platformstring
│ ├── reasonstring
│ └── textstring
├── bot_inline_placeholderstring (optional)
├── lang_codestring (optional)
├── emoji_statusEmojiStatus (optional)
│ ├── EmojiStatusEmpty
│ ├── EmojiStatus
│ │ ├── document_idlong
│ │ └── untilint (optional)
│ │ ├── collectible_idlong
│ │ ├── document_idlong
│ │ ├── titlestring
│ │ ├── slugstring
│ │ ├── pattern_document_idlong
│ │ ├── center_colorint
│ │ ├── edge_colorint
│ │ ├── pattern_colorint
│ │ ├── text_colorint
│ │ └── untilint (optional)
│ ├── collectible_idlong
│ └── untilint (optional)
├── usernamesVector < Username > (optional)
│ └── Username
│ ├── editabletrue (optional)
│ ├── activetrue (optional)
│ └── usernamestring
├── stories_max_idRecentStory (optional)
│ └── RecentStory
│ ├── livetrue (optional)
│ └── max_idint (optional)
├── colorPeerColor (optional)
│ ├── PeerColor
│ │ ├── colorint (optional)
│ │ └── background_emoji_idlong (optional)
│ ├── PeerColorCollectible
│ │ ├── collectible_idlong
│ │ ├── gift_emoji_idlong
│ │ ├── background_emoji_idlong
│ │ ├── accent_colorint
│ │ ├── colorsVector < int >
│ │ ├── dark_accent_colorint (optional)
│ │ └── dark_colorsVector < int > (optional)
│ └── collectible_idlong
├── profile_colorPeerColor (optional)
│ ├── PeerColor
│ │ ├── colorint (optional)
│ │ └── background_emoji_idlong (optional)
│ ├── PeerColorCollectible
│ │ ├── collectible_idlong
│ │ ├── gift_emoji_idlong
│ │ ├── background_emoji_idlong
│ │ ├── accent_colorint
│ │ ├── colorsVector < int >
│ │ ├── dark_accent_colorint (optional)
│ │ └── dark_colorsVector < int > (optional)
│ └── collectible_idlong
├── bot_active_usersint (optional)
├── bot_verification_iconlong (optional)
└── send_paid_messages_starslong (optional)

Example

User(
    is_self=None,
    contact=None,
    mutual_contact=None,
    deleted=None,
    bot=None,
    bot_chat_history=None,
    bot_nochats=None,
    verified=None,
    restricted=None,
    min=None,
    bot_inline_geo=None,
    support=None,
    scam=None,
    apply_min_photo=None,
    fake=None,
    bot_attach_menu=None,
    premium=None,
    attach_menu_enabled=None,
    bot_can_edit=None,
    close_friend=None,
    stories_hidden=None,
    stories_unavailable=None,
    contact_require_premium=None,
    bot_business=None,
    bot_has_main_app=None,
    bot_forum_view=None,
    bot_forum_can_manage_topics=None,
    id=0,
    access_hash=0,
    first_name="text",
    last_name="text",
    username="text",
    phone="+1234567890",
    photo=UserProfilePhotoEmpty(),
    status=UserStatusEmpty(),
    bot_info_version=0,
    restriction_reason=[
            RestrictionReason(
                platform="text",
                reason="text",
                text="Open"
            )
        ],
    bot_inline_placeholder="text",
    lang_code="text",
    emoji_status=EmojiStatusEmpty(),
    usernames=[
            Username(
                editable=None,
                active=None,
                username="text"
            )
        ],
    stories_max_id=RecentStory(
        live=None,
        max_id=None
    ),
    color=PeerColor(
        color=None,
        background_emoji_id=None
    ),
    profile_color=PeerColor(
        color=None,
        background_emoji_id=None
    ),
    bot_active_users=0,
    bot_verification_icon=0,
    send_paid_messages_stars=0,
)