User

Object defines a user.

userEmpty#d3bc4b7a id:long = User;
user#3ff6ecb0 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 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 = User;

---functions---

account.updateProfile#78515775 flags:# first_name:flags.0?string last_name:flags.1?string about:flags.2?string = User;
account.updateUsername#3e0bdd7c username:string = User;
account.changePhone#70c32edb phone_number:string phone_code_hash:string phone_code:string = User;

Constructors

Constructor Description
userEmpty Empty constructor, non-existent user.
user Indicates info about a certain user.

Unless specified otherwise, when updating the local peer database, all fields from the newly received constructor take priority over the old constructor cached locally (including by removing fields that aren't set in the new constructor).

See here ยป for an implementation of the logic to use when updating the local user peer database.

Methods

Method Description
account.updateProfile Updates user profile.
account.updateUsername Changes username for the current user.
account.changePhone Change the phone number of the current account
contacts.importContactToken Obtain user info from a temporary profile link.