Link Search Menu Expand Document

Constructor: user

Back to constructors index

Indicates info about a certain user

Attributes:

NameTypeRequiredDescription
selfBoolOptionalWhether this user indicates the currently logged in user
contactBoolOptionalWhether this user is a contact
mutual_contactBoolOptionalWhether this user is a mutual contact
deletedBoolOptionalWhether the account of this user was deleted
botBoolOptionalIs this user a bot?
bot_chat_historyBoolOptionalCan the bot see all messages in groups?
bot_nochatsBoolOptionalCan the bot be added to groups?
verifiedBoolOptionalWhether this user is verified
restrictedBoolOptionalAccess to this user must be restricted for the reason specified in restriction_reason
minBoolOptionalSee min
bot_inline_geoBoolOptionalWhether the bot can request our geolocation in inline mode
supportBoolOptionalWhether this is an official support user
scamBoolOptionalThis may be a scam user
apply_min_photoBoolOptionalIf set, the profile picture for this user should be refetched
fakeBoolOptionalIf set, this user was reported by many users as a fake or scam user: be careful when interacting with them.
bot_attach_menuBoolOptional
premiumBoolOptional
attach_menu_enabledBoolOptional
idlongYesID of the user
access_hashlongOptionalAccess hash of the user
first_namestringOptionalFirst name
last_namestringOptionalLast name
usernamestringOptionalUsername
phonestringOptionalPhone number
photoUserProfilePhotoOptionalProfile picture of user
statusUserStatusOptionalOnline status of user
bot_info_versionintOptionalVersion of the bot_info field in userFull, incremented every time it changes
restriction_reasonArray of RestrictionReasonOptionalContains the reason why access to this user must be restricted.
bot_inline_placeholderstringOptionalInline placeholder for this inline bot
lang_codestringOptionalLanguage code of the user

Type: User

Example:

$user = ['_' => 'user', 'self' => Bool, 'contact' => Bool, 'mutual_contact' => Bool, 'deleted' => Bool, 'bot' => Bool, 'bot_chat_history' => Bool, 'bot_nochats' => Bool, 'verified' => Bool, 'restricted' => Bool, 'min' => Bool, 'bot_inline_geo' => Bool, 'support' => Bool, 'scam' => Bool, 'apply_min_photo' => Bool, 'fake' => Bool, 'bot_attach_menu' => Bool, 'premium' => Bool, 'attach_menu_enabled' => Bool, 'id' => long, 'access_hash' => long, 'first_name' => 'string', 'last_name' => 'string', 'username' => 'string', 'phone' => 'string', 'photo' => UserProfilePhoto, 'status' => UserStatus, 'bot_info_version' => int, 'restriction_reason' => [RestrictionReason, RestrictionReason], 'bot_inline_placeholder' => 'string', 'lang_code' => 'string'];