CINXE.COM
user
<!DOCTYPE html> <html class=""> <head> <meta charset="utf-8"> <title>user</title> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta property="description" content="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."> <meta property="og:title" content="user"> <meta property="og:image" content=""> <meta property="og:description" content="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."> <link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4"> <link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png"> <link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png"> <link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" /> <link href="/css/bootstrap.min.css?3" rel="stylesheet"> <link href="/css/telegram.css?241" rel="stylesheet" media="screen"> <style> </style> </head> <body class="preload"> <div class="dev_page_wrap"> <div class="dev_page_head navbar navbar-static-top navbar-tg"> <div class="navbar-inner"> <div class="container clearfix"> <ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul> <ul class="nav navbar-nav"> <li><a href="//telegram.org/">Home</a></li> <li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li> <li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li> <li class=""><a href="/api">API</a></li> <li class=""><a href="/mtproto">Protocol</a></li> <li class="active"><a href="/schema">Schema</a></li> </ul> </div> </div> </div> <div class="container clearfix"> <div class="dev_page"> <div id="dev_page_content_wrap" class=" "> <div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/schema" >TL-schema</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/constructor/user" >user</a></li></ul></div> <h1 id="dev_page_title">user</h1> <div id="dev_page_content"><p>Indicates info about a certain user.</p> <p>Unless specified otherwise, when updating the <a href="/api/peers">local peer database</a>, 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).</p> <p>See <a href="https://github.com/tdlib/td/blob/cb164927417f22811c74cd8678ed4a5ab7cb80ba/td/telegram/UserManager.cpp#L2267">here 禄</a> for an implementation of the logic to use when updating the <a href="/api/peers">local user peer database</a>.</p> <p><div class="clearfix"> <ul class="dev_layer_select slightly-pull-right nav nav-pills"> <li class="dropdown"> <a class="dropdown-toggle" onclick="return dropdownClick(this, event)" href="#">Layer 185 <b class="caret"></b></a> <ul class="dropdown-menu"> <li><a href="?layer=1">1 – Base layer</a></li><li><a href="?layer=2">2 – New userpic notifications</a></li><li><a href="?layer=3">3 – Send message can trigger link change</a></li><li><a href="?layer=4">4 – Check-in chats</a></li><li><a href="?layer=5">5 – Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 – Foursquare integration</a></li><li><a href="?layer=7">7 – Added wallPaperSolid</a></li><li><a href="?layer=8">8 – Added end-to-end encryption</a></li><li><a href="?layer=9">9 – Improved big files upload perfomance</a></li><li><a href="?layer=10">10 – Improved chat participants updates</a></li><li><a href="?layer=11">11 – Improved secret chats</a></li><li><a href="?layer=12">12 – New dynamic support</a></li><li><a href="?layer=13">13 – Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 – Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 – Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 – Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 – Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 – Added usernames</a></li><li><a href="?layer=23">23 – Stickers for secret chats</a></li><li><a href="?layer=105">105 – Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 – Login with QR code</a></li><li><a href="?layer=109">109 – Polls v2</a></li><li><a href="?layer=110">110 – People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 – Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 – Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 – PSA</a></li><li><a href="?layer=114">114 – Video thumbs for GIFs</a></li><li><a href="?layer=115">115 – Peek Channel Invite</a></li><li><a href="?layer=116">116 – Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 – WebRTC Phone Calls</a></li><li><a href="?layer=118">118 – Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 – Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 – Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 – SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 – Voice Chats</a></li><li><a href="?layer=123">123 – Voice Chat improvements</a></li><li><a href="?layer=124">124 – Expiring Invite links</a></li><li><a href="?layer=125">125 – Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 – Ban channels in channels</a></li><li><a href="?layer=127">127 – Payments in channels</a></li><li><a href="?layer=128">128 – Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 – Video Chats</a></li><li><a href="?layer=130">130 – Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 – Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 – Chat themes</a></li><li><a href="?layer=133">133 – 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 – Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 – Send Message As a Channel</a></li><li><a href="?layer=136">136 – Reactions</a></li><li><a href="?layer=137">137 – Translations</a></li><li><a href="?layer=138">138 – GIF Sticker Packs</a></li><li><a href="?layer=139">139 – RTMP streaming</a></li><li><a href="?layer=140">140 – WebApps, Cloud Ringtones</a></li><li><a href="?layer=142">142 – TCP Reflectors</a></li><li><a href="?layer=143">143 – Premium Subscription, Cloud Invoices</a></li><li><a href="?layer=144">144 – Premium as a Gift, Custom Emoji</a></li><li><a href="?layer=145">145 – Custom Reactions, Statuses, Sign In with email</a></li><li><a href="?layer=147">147 – Keywords for stickers and emojis</a></li><li><a href="?layer=148">148 – Forums, collectible usernames</a></li><li><a href="?layer=150">150 – Pinned forum topics, general topic</a></li><li><a href="?layer=151">151 – Media spoilers, suggested profile photos</a></li><li><a href="?layer=152">152 – Real-time translations, Firebase SMS authentication</a></li><li><a href="?layer=153">153 – Modify created stickersets</a></li><li><a href="?layer=155">155 – Dates for reactions</a></li><li><a href="?layer=158">158 – Shared folders, per-chat wallpapers</a></li><li><a href="?layer=159">159 – Anonymous votes</a></li><li><a href="?layer=160">160 – Stories</a></li><li><a href="?layer=164">164 – Stories in Channels</a></li><li><a href="?layer=166">166 – Giveaways in channels</a></li><li><a href="?layer=167">167 – Similar channels</a></li><li><a href="?layer=168">168 – Channel colors</a></li><li><a href="?layer=169">169 – Multiselection of chats for bots</a></li><li><a href="?layer=170">170 – Saved Messages 2.0</a></li><li><a href="?layer=171">171 – Saved Messages 2.0</a></li><li><a href="?layer=174">174 – Group boosts</a></li><li><a href="?layer=176">176 – Business</a></li><li><a href="?layer=177">177 – Business Bots, Birthdays</a></li><li><a href="?layer=178">178 – Saved Personal channel, Reactions notifications</a></li><li><a href="?layer=179">179 – Channel revenue stats, phrases in SMS</a></li><li><a href="?layer=180">180 – Message Effects, Hashtags</a></li><li><a href="?layer=181">181 – Stars</a></li><li><a href="?layer=182">182 – Stars Revenue</a></li><li><a href="?layer=183">183 – Paid posts</a></li><li><a href="?layer=184">184 – Stars Refunds</a></li><li><a href="?layer=185"><strong>185 – MiniApp Store, Star Gifts</strong></a></li> <li class="divider"></li> <li><a href="/api/layers">More...</a></li> </ul> </li> </ul> </div> <pre class="page_scheme"><code><a href="/constructor/user" class="current_page_link" >user</a>#83314fca flags:<a href="/type/%23" >#</a> 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:<a href="/type/%23" >#</a> 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 id:<a href="/type/long" >long</a> access_hash:flags.0?<a href="/type/long" >long</a> first_name:flags.1?<a href="/type/string" >string</a> last_name:flags.2?<a href="/type/string" >string</a> username:flags.3?<a href="/type/string" >string</a> phone:flags.4?<a href="/type/string" >string</a> photo:flags.5?<a href="/type/UserProfilePhoto" >UserProfilePhoto</a> status:flags.6?<a href="/type/UserStatus" >UserStatus</a> bot_info_version:flags.14?<a href="/type/int" >int</a> restriction_reason:flags.18?<a href="/type/Vector%20t" >Vector</a><<a href="/type/RestrictionReason" >RestrictionReason</a>> bot_inline_placeholder:flags.19?<a href="/type/string" >string</a> lang_code:flags.22?<a href="/type/string" >string</a> emoji_status:flags.30?<a href="/type/EmojiStatus" >EmojiStatus</a> usernames:flags2.0?<a href="/type/Vector%20t" >Vector</a><<a href="/type/Username" >Username</a>> stories_max_id:flags2.5?<a href="/type/int" >int</a> color:flags2.8?<a href="/type/PeerColor" >PeerColor</a> profile_color:flags2.9?<a href="/type/PeerColor" >PeerColor</a> bot_active_users:flags2.12?<a href="/type/int" >int</a> = <a href="/type/User" >User</a>;</code></pre></p> <h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3> <table class="table"> <thead> <tr> <th>Name</th> <th style="text-align: center;">Type</th> <th>Description</th> </tr> </thead> <tbody> <tr> <td><strong>flags</strong></td> <td style="text-align: center;"><a href="/type/%23">#</a></td> <td>Flags, see <a href="/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></td> </tr> <tr> <td><strong>self</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.10?<a href="/constructor/true">true</a></td> <td>Whether this user indicates the currently logged in user</td> </tr> <tr> <td><strong>contact</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.11?<a href="/constructor/true">true</a></td> <td>Whether this user is a contact <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag is set.</td> </tr> <tr> <td><strong>mutual_contact</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.12?<a href="/constructor/true">true</a></td> <td>Whether this user is a mutual contact. <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag is set.</td> </tr> <tr> <td><strong>deleted</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.13?<a href="/constructor/true">true</a></td> <td>Whether the account of this user was deleted. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here 禄</a> for more info.</td> </tr> <tr> <td><strong>bot</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/constructor/true">true</a></td> <td>Is this user a bot? <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here 禄</a> for more info.</td> </tr> <tr> <td><strong>bot_chat_history</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.15?<a href="/constructor/true">true</a></td> <td>Can the bot see all messages in groups?</td> </tr> <tr> <td><strong>bot_nochats</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.16?<a href="/constructor/true">true</a></td> <td>Can the bot be added to groups?</td> </tr> <tr> <td><strong>verified</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.17?<a href="/constructor/true">true</a></td> <td>Whether this user is verified</td> </tr> <tr> <td><strong>restricted</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.18?<a href="/constructor/true">true</a></td> <td>Access to this user must be restricted for the reason specified in <code>restriction_reason</code></td> </tr> <tr> <td><strong>min</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.20?<a href="/constructor/true">true</a></td> <td>See <a href="/api/min">min</a></td> </tr> <tr> <td><strong>bot_inline_geo</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.21?<a href="/constructor/true">true</a></td> <td>Whether the bot can request our geolocation in inline mode</td> </tr> <tr> <td><strong>support</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.23?<a href="/constructor/true">true</a></td> <td>Whether this is an official support user</td> </tr> <tr> <td><strong>scam</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.24?<a href="/constructor/true">true</a></td> <td>This may be a scam user</td> </tr> <tr> <td><strong>apply_min_photo</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.25?<a href="/constructor/true">true</a></td> <td>If set and <code>min</code> is set, the value of <code>photo</code> can be used to update the local database, see the documentation of that flag for more info.</td> </tr> <tr> <td><strong>fake</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.26?<a href="/constructor/true">true</a></td> <td>If set, this user was reported by many users as a fake or scam user: be careful when interacting with them.</td> </tr> <tr> <td><strong>bot_attach_menu</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.27?<a href="/constructor/true">true</a></td> <td>Whether this bot offers an <a href="/api/bots/attach">attachment menu web app</a></td> </tr> <tr> <td><strong>premium</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.28?<a href="/constructor/true">true</a></td> <td>Whether this user is a Telegram Premium user <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here 禄</a> for more info. <br>Changes to this flag if the <code>self</code> flag is set should also trigger the following calls, to refresh the respective caches: <br>- The <a href="/method/help.getConfig">help.getConfig</a> cache <br>- The <a href="/method/messages.getTopReactions">messages.getTopReactions</a> cache if the <code>bot</code> flag is <strong>not</strong> set</td> </tr> <tr> <td><strong>attach_menu_enabled</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.29?<a href="/constructor/true">true</a></td> <td>Whether we installed the <a href="/api/bots/attach">attachment menu web app</a> offered by this bot. <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag is set.</td> </tr> <tr> <td><strong>flags2</strong></td> <td style="text-align: center;"><a href="/type/%23">#</a></td> <td>Flags, see <a href="/mtproto/TL-combinators#conditional-fields">TL conditional fields</a></td> </tr> <tr> <td><strong>bot_can_edit</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.1?<a href="/constructor/true">true</a></td> <td>Whether we can edit the profile picture, name, about text and description of this bot because we own it. <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag is set. <br>Changes to this flag (if <code>min</code> is not set) should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td> </tr> <tr> <td><strong>close_friend</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.2?<a href="/constructor/true">true</a></td> <td>Whether we marked this user as a <a href="/api/privacy">close friend, see here 禄 for more info</a>. <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag is set.</td> </tr> <tr> <td><strong>stories_hidden</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.3?<a href="/constructor/true">true</a></td> <td>Whether we have <a href="/api/stories#hiding-stories-of-other-users">hidden 禄</a> all active stories of this user. <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag is set.</td> </tr> <tr> <td><strong>stories_unavailable</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.4?<a href="/constructor/true">true</a></td> <td>No stories from this user are visible.</td> </tr> <tr> <td><strong>contact_require_premium</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.10?<a href="/constructor/true">true</a></td> <td>If set, we can only write to this user if they have already sent some messages to us, if we are subscribed to <a href="/api/premium">Telegram Premium</a>, or if they're a mutual contact (<a href="/constructor/user">user</a>.<code>mutual_contact</code>). <br>All the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if this flag is set (i.e. a mutual contact will have this flag set even if we can still write to them, and so on...); to avoid doing these extra checks if we haven't yet cached all the required information (for example while displaying the chat list in the sharing UI) the <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> method may be invoked instead, passing the list of users currently visible in the UI, returning a list of booleans that directly specify whether we can or cannot write to each user; alternatively, the <a href="/constructor/userFull">userFull</a>.<code>contact_require_premium</code> flag contains the same (fully checked, i.e. it's not just a copy of this flag) info returned by <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a>. <br>To set this flag for ourselves invoke <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>, setting the <code>settings.new_noncontact_peers_require_premium</code> flag.</td> </tr> <tr> <td><strong>bot_business</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.11?<a href="/constructor/true">true</a></td> <td>Whether this bot can be <a href="/api/business#connected-bots">connected to a user as specified here 禄</a>.</td> </tr> <tr> <td><strong>bot_has_main_app</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.13?<a href="/constructor/true">true</a></td> <td>If set, this bot has configured a <a href="/api/bots/webapps#main-mini-apps">Main Mini App 禄</a>.</td> </tr> <tr> <td><strong>id</strong></td> <td style="text-align: center;"><a href="/type/long">long</a></td> <td>ID of the user, see <a href="/api/peers#peer-id">here 禄</a> for more info.</td> </tr> <tr> <td><strong>access_hash</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/long">long</a></td> <td>Access hash of the user, see <a href="/api/peers#access-hash">here 禄</a> for more info. <br>If this flag is set, when updating the <a href="/api/peers">local peer database</a>, generate a virtual flag called <code>min_access_hash</code>, which is: <br>- Set to <code>true</code> if <code>min</code> is set AND <br>- The <code>phone</code> flag is <strong>not</strong> set OR <br>- The <code>phone</code> flag is set and the associated phone number string is non-empty <br>- Set to <code>false</code> otherwise. <br><br>Then, apply both <code>access_hash</code> and <code>min_access_hash</code> to the local database if: <br>- <code>min_access_hash</code> is false OR <br>- <code>min_access_hash</code> is true AND <br>- There is no locally cached object for this user OR <br>- There is no <code>access_hash</code> in the local cache OR <br>- The cached object's <code>min_access_hash</code> is also true <br>If the final merged object stored to the database has the <code>min_access_hash</code> field set to true, the related <code>access_hash</code> is <strong>only</strong> suitable to use in <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> 禄</a>, to directly <a href="/api/files">download the profile pictures</a> of users, everywhere else a <code>inputPeer*FromMessage</code> constructor will have to be generated as specified <a href="/api/min">here 禄</a>. <br>Bots can also use min access hashes in some conditions, by passing <code>0</code> instead of the min access hash.</td> </tr> <tr> <td><strong>first_name</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.1?<a href="/type/string">string</a></td> <td>First name. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set.</td> </tr> <tr> <td><strong>last_name</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.2?<a href="/type/string">string</a></td> <td>Last name. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set.</td> </tr> <tr> <td><strong>username</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.3?<a href="/type/string">string</a></td> <td>Main active username. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID if the above conditions are respected and the <code>bot_can_edit</code> flag is also set.</td> </tr> <tr> <td><strong>phone</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.4?<a href="/type/string">string</a></td> <td>Phone number. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set.</td> </tr> <tr> <td><strong>photo</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.5?<a href="/type/UserProfilePhoto">UserProfilePhoto</a></td> <td>Profile picture of user. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>apply_min_photo</code> flag is set OR <br>- The <code>min</code> flag of the locally cached user entry is set.</td> </tr> <tr> <td><strong>status</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.6?<a href="/type/UserStatus">UserStatus</a></td> <td>Online status of user. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set OR <br>- The locally cached user entry is equal to <a href="/constructor/userStatusEmpty">userStatusEmpty</a>.</td> </tr> <tr> <td><strong>bot_info_version</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.14?<a href="/type/int">int</a></td> <td>Version of the <a href="/constructor/userFull">bot_info field in userFull</a>, incremented every time it changes. <br>Changes to this flag should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID, see <a href="/api/peers#full-info-database">here 禄</a> for more info.</td> </tr> <tr> <td><strong>restriction_reason</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.18?<a href="/type/Vector%20t">Vector</a><<a href="/type/RestrictionReason">RestrictionReason</a>></td> <td>Contains the reason why access to this user must be restricted.</td> </tr> <tr> <td><strong>bot_inline_placeholder</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.19?<a href="/type/string">string</a></td> <td>Inline placeholder for this inline bot</td> </tr> <tr> <td><strong>lang_code</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.22?<a href="/type/string">string</a></td> <td>Language code of the user</td> </tr> <tr> <td><strong>emoji_status</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.30?<a href="/type/EmojiStatus">EmojiStatus</a></td> <td><a href="/api/emoji-status">Emoji status</a></td> </tr> <tr> <td><strong>usernames</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.0?<a href="/type/Vector%20t">Vector</a><<a href="/type/Username">Username</a>></td> <td>Additional usernames. <br>When updating the <a href="/api/peers">local peer database</a>, apply changes to this field only if: <br>- The <code>min</code> flag is not set OR <br>- The <code>min</code> flag is set AND <br>- The <code>min</code> flag of the locally cached user entry is set. <br>Changes to this flag (if the above conditions are respected) should invalidate the local <a href="/constructor/userFull">userFull</a> cache for this user ID.</td> </tr> <tr> <td><strong>stories_max_id</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.5?<a href="/type/int">int</a></td> <td>ID of the maximum read <a href="/api/stories">story</a>. <br>When updating the <a href="/api/peers">local peer database</a>, do not apply changes to this field if the <code>min</code> flag of the incoming constructor is set.</td> </tr> <tr> <td><strong>color</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.8?<a href="/type/PeerColor">PeerColor</a></td> <td>The user's <a href="/api/colors">accent color</a>.</td> </tr> <tr> <td><strong>profile_color</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.9?<a href="/type/PeerColor">PeerColor</a></td> <td>The user's <a href="/api/colors">profile color</a>.</td> </tr> <tr> <td><strong>bot_active_users</strong></td> <td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags2</a>.12?<a href="/type/int">int</a></td> <td>Monthly Active Users (MAU) of this bot (may be absent for small bots).</td> </tr> </tbody> </table> <h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3> <p><a href="/type/User">User</a></p> <h3><a class="anchor" href="#related-pages" id="related-pages" name="related-pages"><i class="anchor-icon"></i></a>Related pages</h3> <h4><a class="anchor" href="#peer-database" id="peer-database" name="peer-database"><i class="anchor-icon"></i></a><a href="/api/peers">Peer database</a></h4> <p>Many constructors in the API need to be stored in a local database upon reception and should only ever be updated reactively (passively) when received via updates or by other means (as specified in the documentation), to avoid overloading the server by continuously requesting changes for the same unchanged information.</p> <h4><a class="anchor" href="#userfull" id="userfull" name="userfull"><i class="anchor-icon"></i></a><a href="/constructor/userFull">userFull</a></h4> <p>Extended user info</p> <p>When updating the <a href="/api/peers">local peer database 禄</a>, 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).</p> <h4><a class="anchor" href="#min-constructors" id="min-constructors" name="min-constructors"><i class="anchor-icon"></i></a><a href="/api/min">Min constructors</a></h4> <p>In some situations user and channel constructors have reduced set of fields present (although id is always there) and min flag set.</p> <h4><a class="anchor" href="#bot-attachment-menu-and-side-menu-entries" id="bot-attachment-menu-and-side-menu-entries" name="bot-attachment-menu-and-side-menu-entries"><i class="anchor-icon"></i></a><a href="/api/bots/attach">Bot attachment menu and side menu entries</a></h4> <p>Bots can install attachment menu and side menu entries, offering conveniently accessible, versatile web apps.</p> <h4><a class="anchor" href="#helpgetconfig" id="helpgetconfig" name="helpgetconfig"><i class="anchor-icon"></i></a><a href="/method/help.getConfig">help.getConfig</a></h4> <p>Returns current configuration, including data center configuration.</p> <h4><a class="anchor" href="#messagesgettopreactions" id="messagesgettopreactions" name="messagesgettopreactions"><i class="anchor-icon"></i></a><a href="/method/messages.getTopReactions">messages.getTopReactions</a></h4> <p>Got popular <a href="/api/reactions">message reactions</a></p> <h4><a class="anchor" href="#privacy" id="privacy" name="privacy"><i class="anchor-icon"></i></a><a href="/api/privacy">Privacy</a></h4> <p>Telegram allows users to specify granular privacy settings, choosing which users can or can't interact with them in certain ways.</p> <h4><a class="anchor" href="#stories" id="stories" name="stories"><i class="anchor-icon"></i></a><a href="/api/stories">Stories</a></h4> <p>Telegram users and channels can easily post and view stories through the API.</p> <h4><a class="anchor" href="#telegram-premium" id="telegram-premium" name="telegram-premium"><i class="anchor-icon"></i></a><a href="/api/premium">Telegram Premium</a></h4> <p>Telegram Premium is an optional subscription service that unlocks additional exclusive client-side and API-side features, while helping support the development of the app.</p> <h4><a class="anchor" href="#user" id="user" name="user"><i class="anchor-icon"></i></a><a href="/constructor/user">user</a></h4> <p>Indicates info about a certain user.</p> <p>Unless specified otherwise, when updating the <a href="/api/peers">local peer database</a>, 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).</p> <p>See <a href="https://github.com/tdlib/td/blob/cb164927417f22811c74cd8678ed4a5ab7cb80ba/td/telegram/UserManager.cpp#L2267">here 禄</a> for an implementation of the logic to use when updating the <a href="/api/peers">local user peer database</a>.</p> <h4><a class="anchor" href="#usersgetispremiumrequiredtocontact" id="usersgetispremiumrequiredtocontact" name="usersgetispremiumrequiredtocontact"><i class="anchor-icon"></i></a><a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a></h4> <p>Check whether we can write to the specified user (this method can only be called by non-<a href="/api/premium">Premium</a> users), see <a href="/api/privacy#require-premium-for-new-non-contact-users">here 禄</a> for more info on the full flow.</p> <h4><a class="anchor" href="#accountsetglobalprivacysettings" id="accountsetglobalprivacysettings" name="accountsetglobalprivacysettings"><i class="anchor-icon"></i></a><a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a></h4> <p>Set global privacy settings</p> <h4><a class="anchor" href="#business" id="business" name="business"><i class="anchor-icon"></i></a><a href="/api/business">Business</a></h4> <p>Users can turn their Telegram account into a business account, gaining access to business features such as opening hours, location, quick replies, automated messages, custom start pages, chatbot support, and more.</p> <h4><a class="anchor" href="#mini-apps-on-telegram" id="mini-apps-on-telegram" name="mini-apps-on-telegram"><i class="anchor-icon"></i></a><a href="/api/bots/webapps">Mini Apps on Telegram</a></h4> <p>Bots can offer users interactive HTML5 web apps to completely replace any website.</p> <h4><a class="anchor" href="#inputpeerphotofilelocation" id="inputpeerphotofilelocation" name="inputpeerphotofilelocation"><i class="anchor-icon"></i></a><a href="/constructor/inputPeerPhotoFileLocation">inputPeerPhotoFileLocation</a></h4> <p>Location of profile photo of channel/group/supergroup/user</p> <h4><a class="anchor" href="#uploading-and-downloading-files" id="uploading-and-downloading-files" name="uploading-and-downloading-files"><i class="anchor-icon"></i></a><a href="/api/files">Uploading and Downloading Files</a></h4> <p>How to transfer large data batches correctly.</p> <h4><a class="anchor" href="#userstatusempty" id="userstatusempty" name="userstatusempty"><i class="anchor-icon"></i></a><a href="/constructor/userStatusEmpty">userStatusEmpty</a></h4> <p>User status has not been set yet.</p> <h4><a class="anchor" href="#emoji-status" id="emoji-status" name="emoji-status"><i class="anchor-icon"></i></a><a href="/api/emoji-status">Emoji status</a></h4> <p>Telegram allows users to set an emoticon or a custom emoji as status, to show next to their name in chats and profiles.</p> <h4><a class="anchor" href="#accent-colors" id="accent-colors" name="accent-colors"><i class="anchor-icon"></i></a><a href="/api/colors">Accent colors</a></h4> <p>Telegram users and channels can change the accent color and background pattern of their profile page and their messages!</p></div> </div> </div> </div> <div class="footer_wrap"> <div class="footer_columns_wrap footer_desktop"> <div class="footer_column footer_column_telegram"> <h5>Telegram</h5> <div class="footer_telegram_description"></div> Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed. </div> <div class="footer_column"> <h5><a href="//telegram.org/faq">About</a></h5> <ul> <li><a href="//telegram.org/faq">FAQ</a></li> <li><a href="//telegram.org/privacy">Privacy</a></li> <li><a href="//telegram.org/press">Press</a></li> </ul> </div> <div class="footer_column"> <h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5> <ul> <li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li> <li><a href="//telegram.org/android">Android</a></li> <li><a href="//telegram.org/dl/web">Mobile Web</a></li> </ul> </div> <div class="footer_column"> <h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5> <ul> <li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li> <li><a href="//macos.telegram.org/">macOS</a></li> <li><a href="//telegram.org/dl/web">Web-browser</a></li> </ul> </div> <div class="footer_column footer_column_platform"> <h5><a href="/">Platform</a></h5> <ul> <li><a href="/api">API</a></li> <li><a href="//translations.telegram.org/">Translations</a></li> <li><a href="//instantview.telegram.org/">Instant View</a></li> </ul> </div> </div> <div class="footer_columns_wrap footer_mobile"> <div class="footer_column"> <h5><a href="//telegram.org/faq">About</a></h5> </div> <div class="footer_column"> <h5><a href="//telegram.org/blog">Blog</a></h5> </div> <div class="footer_column"> <h5><a href="//telegram.org/apps">Apps</a></h5> </div> <div class="footer_column"> <h5><a href="/">Platform</a></h5> </div> <div class="footer_column"> <h5><a href="//telegram.org/press">Press</a></h5> </div> </div> </div> </div> <script src="/js/main.js?47"></script> <script>backToTopInit("Go up"); removePreloadInit(); </script> </body> </html> <!-- page generated in 13.4ms -->