telegram-crawler/data/web/blogfork.telegram.org/api/privacy.html
2024-09-17 22:21:45 +00:00

217 lines
28 KiB
HTML
Raw Blame History

This file contains invisible Unicode characters

This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Privacy</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Telegram allows users to specify granular privacy settings, choosing which users can or can&#39;t interact with them in certain ways.">
<meta property="og:title" content="Privacy">
<meta property="og:image" content="">
<meta property="og:description" content="Telegram allows users to specify granular privacy settings, choosing which users can or can&#39;t interact with them in certain ways.">
<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?240" 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="active"><a href="/api">API</a></li>
<li class=""><a href="/mtproto">Protocol</a></li>
<li class=""><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="/api/privacy" >Privacy</a></li></ul></div>
<h1 id="dev_page_title">Privacy</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p>Telegram allows users to specify granular privacy settings, choosing which users can or can't interact with them in certain ways.</p>
<h3><a class="anchor" href="#privacy-rules" id="privacy-rules" name="privacy-rules"><i class="anchor-icon"></i></a>Privacy rules</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/inputPrivacyValueAllowContacts'>inputPrivacyValueAllowContacts</a>#d09e07b = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowAll'>inputPrivacyValueAllowAll</a>#184b35ce = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowUsers'>inputPrivacyValueAllowUsers</a>#131cc67f users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowContacts'>inputPrivacyValueDisallowContacts</a>#ba52007 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowAll'>inputPrivacyValueDisallowAll</a>#d66b66c9 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowUsers'>inputPrivacyValueDisallowUsers</a>#90110467 users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowChatParticipants'>inputPrivacyValueAllowChatParticipants</a>#840649cf chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueDisallowChatParticipants'>inputPrivacyValueDisallowChatParticipants</a>#e94f0f86 chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowCloseFriends'>inputPrivacyValueAllowCloseFriends</a>#2f453e49 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/inputPrivacyValueAllowPremium'>inputPrivacyValueAllowPremium</a>#77cdc9f1 = <a href='/type/InputPrivacyRule'>InputPrivacyRule</a>;
<a href='/constructor/privacyValueAllowContacts'>privacyValueAllowContacts</a>#fffe1bac = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowAll'>privacyValueAllowAll</a>#65427b82 = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowUsers'>privacyValueAllowUsers</a>#b8905fb2 users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowContacts'>privacyValueDisallowContacts</a>#f888fa1a = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowAll'>privacyValueDisallowAll</a>#8b73e763 = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowUsers'>privacyValueDisallowUsers</a>#e4621141 users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowChatParticipants'>privacyValueAllowChatParticipants</a>#6b134e8e chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueDisallowChatParticipants'>privacyValueDisallowChatParticipants</a>#41c87565 chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowCloseFriends'>privacyValueAllowCloseFriends</a>#f7e8d89b = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/privacyValueAllowPremium'>privacyValueAllowPremium</a>#ece9814b = <a href='/type/PrivacyRule'>PrivacyRule</a>;
<a href='/constructor/user'>user</a>#83314fca flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> contact_require_premium:flags2.10?<a href='/constructor/true'>true</a> bot_business:flags2.11?<a href='/constructor/true'>true</a> bot_has_main_app:flags2.13?<a href='/constructor/true'>true</a> 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>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; 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>&lt;<a href='/type/Username'>Username</a>&gt; 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>;
---functions---
<a href='/method/contacts.editCloseFriends'>contacts.editCloseFriends</a>#ba6705f0 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>Privacy <strong>rules</strong> indicate <em>who</em> can or can't do something and are specified by a <a href="/type/PrivacyRule">PrivacyRule</a>, and its input counterpart <a href="/type/InputPrivacyRule">InputPrivacyRule</a>.<br>
<a href="/type/InputPrivacyRule">InputPrivacyRule</a> constructors are <em>passed</em> as input to methods that accept privacy rules, while <a href="/type/PrivacyRule">PrivacyRule</a>s are contained in constructors <em>returned</em> by the API. </p>
<p>See <a href="/type/InputPrivacyRule">the type page »</a> for a full list of privacy rules and their descriptions. </p>
<p>One privacy rule in particular should be mentioned separately, (input)<a href="/constructor/privacyValueAllowCloseFriends">privacyValueAllowCloseFriends</a>: this privacy rule, which can be used only when <a href="/api/stories">posting stories</a>, refers exclusively to a list of "close friends", that can be modified using <a href="/method/contacts.editCloseFriends">contacts.editCloseFriends</a>, passing the full close friend list as a list of user IDs: note that only users <a href="/api/contacts">in the contact list (even without a phone number) »</a> can be added to the close friends list. </p>
<p>The current list of close friends can be checking which users in our contact list have the <code>close_friend</code> flag set in the associated <a href="/constructor/user">user</a> constructor, see <a href="/api/contacts#fetching-the-contact-list">here »</a> for more info on how to fetch the contact list.</p>
<h3><a class="anchor" href="#privacy-keys" id="privacy-keys" name="privacy-keys"><i class="anchor-icon"></i></a>Privacy keys</h3>
<p>Schema:</p>
<pre><code><a href='/constructor/inputPrivacyKeyStatusTimestamp'>inputPrivacyKeyStatusTimestamp</a>#4f96cb18 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyChatInvite'>inputPrivacyKeyChatInvite</a>#bdfb0426 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyPhoneCall'>inputPrivacyKeyPhoneCall</a>#fabadc5f = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyPhoneP2P'>inputPrivacyKeyPhoneP2P</a>#db9e70d2 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyForwards'>inputPrivacyKeyForwards</a>#a4dd4c08 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyProfilePhoto'>inputPrivacyKeyProfilePhoto</a>#5719bacc = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyPhoneNumber'>inputPrivacyKeyPhoneNumber</a>#352dafa = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyAddedByPhone'>inputPrivacyKeyAddedByPhone</a>#d1219bdd = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyVoiceMessages'>inputPrivacyKeyVoiceMessages</a>#aee69d68 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyAbout'>inputPrivacyKeyAbout</a>#3823cc40 = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/inputPrivacyKeyBirthday'>inputPrivacyKeyBirthday</a>#d65a11cc = <a href='/type/InputPrivacyKey'>InputPrivacyKey</a>;
<a href='/constructor/privacyKeyStatusTimestamp'>privacyKeyStatusTimestamp</a>#bc2eab30 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyChatInvite'>privacyKeyChatInvite</a>#500e6dfa = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyPhoneCall'>privacyKeyPhoneCall</a>#3d662b7b = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyPhoneP2P'>privacyKeyPhoneP2P</a>#39491cc8 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyForwards'>privacyKeyForwards</a>#69ec56a3 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyProfilePhoto'>privacyKeyProfilePhoto</a>#96151fed = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyPhoneNumber'>privacyKeyPhoneNumber</a>#d19ae46d = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyAddedByPhone'>privacyKeyAddedByPhone</a>#42ffd42b = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyVoiceMessages'>privacyKeyVoiceMessages</a>#697f414 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/privacyKeyAbout'>privacyKeyAbout</a>#a486b761 = <a href='/type/PrivacyKey'>PrivacyKey</a>;
<a href='/constructor/account.privacyRules'>account.privacyRules</a>#50a04e45 rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PrivacyRule'>PrivacyRule</a>&gt; chats:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Chat'>Chat</a>&gt; users:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/User'>User</a>&gt; = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;
<a href='/constructor/updatePrivacy'>updatePrivacy</a>#ee3b272a key:<a href='/type/PrivacyKey'>PrivacyKey</a> rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PrivacyRule'>PrivacyRule</a>&gt; = <a href='/type/Update'>Update</a>;
---functions---
<a href='/method/account.getPrivacy'>account.getPrivacy</a>#dadbc950 key:<a href='/type/InputPrivacyKey'>InputPrivacyKey</a> = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;
<a href='/method/account.setPrivacy'>account.setPrivacy</a>#c9f81ce8 key:<a href='/type/InputPrivacyKey'>InputPrivacyKey</a> rules:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputPrivacyRule'>InputPrivacyRule</a>&gt; = <a href='/type/account.PrivacyRules'>account.PrivacyRules</a>;</code></pre>
<p>Privacy <strong>keys</strong> together with <a href="#privacy-rules">privacy rules »</a> indicate <em>what</em> can or can't someone do and are specified by a <a href="/type/PrivacyKey">PrivacyKey</a> constructor, and its input counterpart <a href="/type/InputPrivacyKey">InputPrivacyKey</a>.<br>
<a href="/type/InputPrivacyKey">InputPrivacyKey</a> constructors are <em>passed</em> as input to methods that accept privacy keys, while <a href="/type/PrivacyKey">PrivacyKey</a>s are contained in constructors <em>returned</em> by the API. </p>
<p>See <a href="/type/InputPrivacyKey">the type page »</a> for a full list of privacy keys and their descriptions. </p>
<p>Use <a href="/method/account.getPrivacy">account.getPrivacy</a> to obtain the current set of <a href="#privacy-rules">rules</a> associated to a key, and <a href="/method/account.setPrivacy">account.setPrivacy</a> to change it.</p>
<p>Changing the privacy settings will trigger an <a href="/constructor/updatePrivacy">updatePrivacy</a>, sent to all currently logged in sessions of the current account.</p>
<h3><a class="anchor" href="#global-privacy-settings" id="global-privacy-settings" name="global-privacy-settings"><i class="anchor-icon"></i></a>Global privacy settings</h3>
<pre><code><a href='/constructor/globalPrivacySettings'>globalPrivacySettings</a>#734c4ccb flags:<a href='/type/%23'>#</a> archive_and_mute_new_noncontact_peers:flags.0?<a href='/constructor/true'>true</a> keep_archived_unmuted:flags.1?<a href='/constructor/true'>true</a> keep_archived_folders:flags.2?<a href='/constructor/true'>true</a> hide_read_marks:flags.3?<a href='/constructor/true'>true</a> new_noncontact_peers_require_premium:flags.4?<a href='/constructor/true'>true</a> = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>;
---functions---
<a href='/method/account.getGlobalPrivacySettings'>account.getGlobalPrivacySettings</a>#eb2b4cf6 = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>;
<a href='/method/account.setGlobalPrivacySettings'>account.setGlobalPrivacySettings</a>#1edaaac2 settings:<a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a> = <a href='/type/GlobalPrivacySettings'>GlobalPrivacySettings</a>;</code></pre>
<p>Some global privacy settings can also be fetched and modified using <a href="/method/account.getGlobalPrivacySettings">account.getGlobalPrivacySettings</a> and <a href="/method/account.setGlobalPrivacySettings">account.setGlobalPrivacySettings</a>. </p>
<p>Global privacy settings are represented by the <a href="/constructor/globalPrivacySettings">globalPrivacySettings</a> constructor, please see the <a href="/constructor/globalPrivacySettings">constructor page</a> for a full description of all settings.</p>
<h4><a class="anchor" href="#require-premium-for-new-non-contact-users" id="require-premium-for-new-non-contact-users" name="require-premium-for-new-non-contact-users"><i class="anchor-icon"></i></a>Require Premium for new non-contact users</h4>
<pre><code><a href='/constructor/user'>user</a>#83314fca flags:<a href='/type/%23'>#</a> self:flags.10?<a href='/constructor/true'>true</a> contact:flags.11?<a href='/constructor/true'>true</a> mutual_contact:flags.12?<a href='/constructor/true'>true</a> deleted:flags.13?<a href='/constructor/true'>true</a> bot:flags.14?<a href='/constructor/true'>true</a> bot_chat_history:flags.15?<a href='/constructor/true'>true</a> bot_nochats:flags.16?<a href='/constructor/true'>true</a> verified:flags.17?<a href='/constructor/true'>true</a> restricted:flags.18?<a href='/constructor/true'>true</a> min:flags.20?<a href='/constructor/true'>true</a> bot_inline_geo:flags.21?<a href='/constructor/true'>true</a> support:flags.23?<a href='/constructor/true'>true</a> scam:flags.24?<a href='/constructor/true'>true</a> apply_min_photo:flags.25?<a href='/constructor/true'>true</a> fake:flags.26?<a href='/constructor/true'>true</a> bot_attach_menu:flags.27?<a href='/constructor/true'>true</a> premium:flags.28?<a href='/constructor/true'>true</a> attach_menu_enabled:flags.29?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> bot_can_edit:flags2.1?<a href='/constructor/true'>true</a> close_friend:flags2.2?<a href='/constructor/true'>true</a> stories_hidden:flags2.3?<a href='/constructor/true'>true</a> stories_unavailable:flags2.4?<a href='/constructor/true'>true</a> contact_require_premium:flags2.10?<a href='/constructor/true'>true</a> bot_business:flags2.11?<a href='/constructor/true'>true</a> bot_has_main_app:flags2.13?<a href='/constructor/true'>true</a> 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>&lt;<a href='/type/RestrictionReason'>RestrictionReason</a>&gt; 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>&lt;<a href='/type/Username'>Username</a>&gt; 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>;
<a href='/constructor/userFull'>userFull</a>#cc997720 flags:<a href='/type/%23'>#</a> blocked:flags.0?<a href='/constructor/true'>true</a> phone_calls_available:flags.4?<a href='/constructor/true'>true</a> phone_calls_private:flags.5?<a href='/constructor/true'>true</a> can_pin_message:flags.7?<a href='/constructor/true'>true</a> has_scheduled:flags.12?<a href='/constructor/true'>true</a> video_calls_available:flags.13?<a href='/constructor/true'>true</a> voice_messages_forbidden:flags.20?<a href='/constructor/true'>true</a> translations_disabled:flags.23?<a href='/constructor/true'>true</a> stories_pinned_available:flags.26?<a href='/constructor/true'>true</a> blocked_my_stories_from:flags.27?<a href='/constructor/true'>true</a> wallpaper_overridden:flags.28?<a href='/constructor/true'>true</a> contact_require_premium:flags.29?<a href='/constructor/true'>true</a> read_dates_private:flags.30?<a href='/constructor/true'>true</a> flags2:<a href='/type/%23'>#</a> sponsored_enabled:flags2.7?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> personal_photo:flags.21?<a href='/type/Photo'>Photo</a> profile_photo:flags.2?<a href='/type/Photo'>Photo</a> fallback_photo:flags.22?<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> bot_info:flags.3?<a href='/type/BotInfo'>BotInfo</a> pinned_msg_id:flags.6?<a href='/type/int'>int</a> common_chats_count:<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> ttl_period:flags.14?<a href='/type/int'>int</a> theme_emoticon:flags.15?<a href='/type/string'>string</a> private_forward_name:flags.16?<a href='/type/string'>string</a> bot_group_admin_rights:flags.17?<a href='/type/ChatAdminRights'>ChatAdminRights</a> bot_broadcast_admin_rights:flags.18?<a href='/type/ChatAdminRights'>ChatAdminRights</a> premium_gifts:flags.19?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/PremiumGiftOption'>PremiumGiftOption</a>&gt; wallpaper:flags.24?<a href='/type/WallPaper'>WallPaper</a> stories:flags.25?<a href='/type/PeerStories'>PeerStories</a> business_work_hours:flags2.0?<a href='/type/BusinessWorkHours'>BusinessWorkHours</a> business_location:flags2.1?<a href='/type/BusinessLocation'>BusinessLocation</a> business_greeting_message:flags2.2?<a href='/type/BusinessGreetingMessage'>BusinessGreetingMessage</a> business_away_message:flags2.3?<a href='/type/BusinessAwayMessage'>BusinessAwayMessage</a> business_intro:flags2.4?<a href='/type/BusinessIntro'>BusinessIntro</a> birthday:flags2.5?<a href='/type/Birthday'>Birthday</a> personal_channel_id:flags2.6?<a href='/type/long'>long</a> personal_channel_message:flags2.6?<a href='/type/int'>int</a> = <a href='/type/UserFull'>UserFull</a>;
---functions---
<a href='/method/users.getIsPremiumRequiredToContact'>users.getIsPremiumRequiredToContact</a>#a622aa10 id:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/InputUser'>InputUser</a>&gt; = <a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/Bool'>Bool</a>&gt;;</code></pre>
<p>If a user enables their <strong>new_noncontact_peers_require_premium</strong> <a href="/api/privacy#global-privacy-settings">global privacy setting</a>, represented in <a href="/constructor/user">user</a>.<code>contact_require_premium</code> for other users, only users that have a premium account, are in our contact list, or already have a private chat with them can write to them in private. </p>
<p>Note that all the secondary conditions listed above must be checked separately to verify whether we can still write to the user, even if <a href="/constructor/user">user</a>.<code>contact_require_premium</code> flag is set for a user (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.<br>
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 <a href="/constructor/user">user</a>.<code>contact_require_premium</code>) info returned by <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a>.</p>
<p>This information may then be used, for example, to display a lock near the avatar of each user that we cannot write to, with an appropriate tooltip to purchase a <a href="/api/premium">Premium</a> subscription.</p>
<p>Note that <a href="/method/users.getIsPremiumRequiredToContact">users.getIsPremiumRequiredToContact</a> should <strong>only</strong> be invoked if we don't have a <a href="/api/premium">Premium</a> subscription, only for users whose full info (<a href="/constructor/userFull">userFull</a> + message history information) is not cached yet, as the same info can be computed locally if all the mentioned information is available, and updated automatically using the usual <a href="/api/updates">updates</a>.</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 src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js?1"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>