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_menuBoolOptionalWhether this bot offers an attachment menu web app
premiumBoolOptionalWhether this user is a Telegram Premium user
attach_menu_enabledBoolOptionalWhether we installed the attachment menu web app offered by this bot
bot_can_editBoolOptional
close_friendBoolOptional
stories_hiddenBoolOptional
stories_unavailableBoolOptional
contact_require_premiumBoolOptional
bot_businessBoolOptional
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
emoji_statusEmojiStatusOptionalEmoji status
usernamesArray of UsernameOptional
stories_max_idintOptional
colorPeerColorOptional
profile_colorPeerColorOptional

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, 'bot_can_edit' => Bool, 'close_friend' => Bool, 'stories_hidden' => Bool, 'stories_unavailable' => Bool, 'contact_require_premium' => Bool, 'bot_business' => 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', 'emoji_status' => EmojiStatus, 'usernames' => [Username, Username], 'stories_max_id' => int, 'color' => PeerColor, 'profile_color' => PeerColor];