Update content of files

This commit is contained in:
GitHub Action 2022-02-28 11:30:37 +00:00
parent bdec59e3bd
commit 4f63a20141
3 changed files with 997 additions and 0 deletions

View file

@ -0,0 +1,140 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Commands</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Bots offer a set of commands that can be used by users in private, or in a chat.">
<meta property="og:title" content="Commands">
<meta property="og:image" content="">
<meta property="og:description" content="Bots offer a set of commands that can be used by users in private, or in a chat.">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?215" 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/bots%2Fcommands" >Commands</a></li></ul></div>
<h1 id="dev_page_title">Commands</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p><a href="/bots">Bots</a> offer a set of <a href="/bots/#commands">commands</a> that can be used by users in private, or in a chat. </p>
<p>For a simplified description using the HTTP bot API, see <a href="/bots/#commands">here »</a>. </p>
<h3><a class="anchor" href="#getting-commands" id="getting-commands" name="getting-commands"><i class="anchor-icon"></i></a>Getting commands</h3>
<pre><code><a href='/constructor/botCommand'>botCommand</a>#c27ac8c7 command:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> = <a href='/type/BotCommand'>BotCommand</a>;
<a href='/constructor/botInfo'>botInfo</a>#1b74b335 user_id:<a href='/type/long'>long</a> description:<a href='/type/string'>string</a> commands:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotCommand'>BotCommand</a>&gt; = <a href='/type/BotInfo'>BotInfo</a>;
<a href='/constructor/channelFull'>channelFull</a>#e13c3d20 flags:<a href='/type/%23'>#</a> can_view_participants:flags.3?<a href='/constructor/true'>true</a> can_set_username:flags.6?<a href='/constructor/true'>true</a> can_set_stickers:flags.7?<a href='/constructor/true'>true</a> hidden_prehistory:flags.10?<a href='/constructor/true'>true</a> can_set_location:flags.16?<a href='/constructor/true'>true</a> has_scheduled:flags.19?<a href='/constructor/true'>true</a> can_view_stats:flags.20?<a href='/constructor/true'>true</a> blocked:flags.22?<a href='/constructor/true'>true</a> id:<a href='/type/long'>long</a> about:<a href='/type/string'>string</a> participants_count:flags.0?<a href='/type/int'>int</a> admins_count:flags.1?<a href='/type/int'>int</a> kicked_count:flags.2?<a href='/type/int'>int</a> banned_count:flags.2?<a href='/type/int'>int</a> online_count:flags.13?<a href='/type/int'>int</a> read_inbox_max_id:<a href='/type/int'>int</a> read_outbox_max_id:<a href='/type/int'>int</a> unread_count:<a href='/type/int'>int</a> chat_photo:<a href='/type/Photo'>Photo</a> notify_settings:<a href='/type/PeerNotifySettings'>PeerNotifySettings</a> exported_invite:flags.23?<a href='/type/ExportedChatInvite'>ExportedChatInvite</a> bot_info:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotInfo'>BotInfo</a>&gt; migrated_from_chat_id:flags.4?<a href='/type/long'>long</a> migrated_from_max_id:flags.4?<a href='/type/int'>int</a> pinned_msg_id:flags.5?<a href='/type/int'>int</a> stickerset:flags.8?<a href='/type/StickerSet'>StickerSet</a> available_min_id:flags.9?<a href='/type/int'>int</a> folder_id:flags.11?<a href='/type/int'>int</a> linked_chat_id:flags.14?<a href='/type/long'>long</a> location:flags.15?<a href='/type/ChannelLocation'>ChannelLocation</a> slowmode_seconds:flags.17?<a href='/type/int'>int</a> slowmode_next_send_date:flags.18?<a href='/type/int'>int</a> stats_dc:flags.12?<a href='/type/int'>int</a> pts:<a href='/type/int'>int</a> call:flags.21?<a href='/type/InputGroupCall'>InputGroupCall</a> ttl_period:flags.24?<a href='/type/int'>int</a> pending_suggestions:flags.25?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; groupcall_default_join_as:flags.26?<a href='/type/Peer'>Peer</a> theme_emoticon:flags.27?<a href='/type/string'>string</a> requests_pending:flags.28?<a href='/type/int'>int</a> recent_requesters:flags.28?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/long'>long</a>&gt; default_send_as:flags.29?<a href='/type/Peer'>Peer</a> available_reactions:flags.30?<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/string'>string</a>&gt; = <a href='/type/ChatFull'>ChatFull</a>;
<a href='/constructor/userFull'>userFull</a>#cf366521 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> id:<a href='/type/long'>long</a> about:flags.1?<a href='/type/string'>string</a> settings:<a href='/type/PeerSettings'>PeerSettings</a> profile_photo:flags.2?<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> = <a href='/type/UserFull'>UserFull</a>;
<a href='/constructor/user'>user</a>#3ff6ecb0 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> 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> = <a href='/type/User'>User</a>;</code></pre>
<p>The <a href="/constructor/botInfo">botInfo</a> constructors contained in the <a href="/constructor/userFull">userFull</a>, <a href="/constructor/chatFull">chatFull</a>, <a href="/constructor/channelFull">channelFull</a> contain a list of commands, and for groups, the ID and a description of each bot. </p>
<p>In graphical clients, when users begin a message with a <code>/</code>, a list of commands supported by all bots present in the current chat should be shown; the same should be done for one-to-one chats with the bot itself. </p>
<p>If the command list of a bot changes, the <code>bot_info_version</code> contained in the <a href="/constructor/user">user</a> constructor received in updates will change; this indicates that the client should refetch full bot information using <a href="/method/users.getFullUser">users.getFullUser</a>.</p>
<h3><a class="anchor" href="#setting-commands" id="setting-commands" name="setting-commands"><i class="anchor-icon"></i></a>Setting commands</h3>
<pre><code><a href='/constructor/botCommand'>botCommand</a>#c27ac8c7 command:<a href='/type/string'>string</a> description:<a href='/type/string'>string</a> = <a href='/type/BotCommand'>BotCommand</a>;
---functions---
<a href='/method/bots.setBotCommands'>bots.setBotCommands</a>#517165a scope:<a href='/type/BotCommandScope'>BotCommandScope</a> lang_code:<a href='/type/string'>string</a> commands:<a href='/type/Vector%20t'>Vector</a>&lt;<a href='/type/BotCommand'>BotCommand</a>&gt; = <a href='/type/Bool'>Bool</a>;</code></pre>
<p>The command list can be changed by the owner of the bot through <a href="https://t.me/botfather">@botfather</a>, but bots can also change their own command list by invoking <a href="/method/bots.setBotCommands">bots.setBotCommands</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/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</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/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</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="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/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="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?43"></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>

View file

@ -0,0 +1,172 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>inputGroupCallStream</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Chunk of a livestream">
<meta property="og:title" content="inputGroupCallStream">
<meta property="og:image" content="">
<meta property="og:description" content="Chunk of a livestream">
<link rel="shortcut icon" href="/favicon.ico?4" type="image/x-icon" />
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
<link href="/css/telegram.css?215" 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/inputGroupCallStream" >inputGroupCallStream</a></li></ul></div>
<h1 id="dev_page_title">inputGroupCallStream</h1>
<div id="dev_page_content"><p>Chunk of a livestream</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 138 <b class="caret"></b></a>
<ul class="dropdown-menu">
<li><a href="?layer=1">1 &ndash; Base layer</a></li><li><a href="?layer=2">2 &ndash; New userpic notifications</a></li><li><a href="?layer=3">3 &ndash; Send message can trigger link change</a></li><li><a href="?layer=4">4 &ndash; Check-in chats</a></li><li><a href="?layer=5">5 &ndash; Localized SMS, localized notifications</a></li><li><a href="?layer=6">6 &ndash; Foursquare integration</a></li><li><a href="?layer=7">7 &ndash; Added wallPaperSolid</a></li><li><a href="?layer=8">8 &ndash; Added end-to-end encryption</a></li><li><a href="?layer=9">9 &ndash; Improved big files upload perfomance</a></li><li><a href="?layer=10">10 &ndash; Improved chat participants updates</a></li><li><a href="?layer=11">11 &ndash; Improved secret chats</a></li><li><a href="?layer=12">12 &ndash; New dynamic support</a></li><li><a href="?layer=13">13 &ndash; Audio, video MIME; contacts import retry; new secret actions</a></li><li><a href="?layer=14">14 &ndash; Notify settings sync, blacklist sync</a></li><li><a href="?layer=15">15 &ndash; Modified getHistory offset behaviour</a></li><li><a href="?layer=16">16 &ndash; Split sendCode into 2 parts</a></li><li><a href="?layer=17">17 &ndash; Added custom typing, introduced message flags</a></li><li><a href="?layer=18">18 &ndash; Added usernames</a></li><li><a href="?layer=23">23 &ndash; Stickers for secret chats</a></li><li><a href="?layer=105">105 &ndash; Scheduled messages, Cloud themes</a></li><li><a href="?layer=108">108 &ndash; Login with QR code</a></li><li><a href="?layer=109">109 &ndash; Polls v2</a></li><li><a href="?layer=110">110 &ndash; People Nearby 2.0, Bank card entity</a></li><li><a href="?layer=111">111 &ndash; Folders, Broadcast Stats</a></li><li><a href="?layer=112">112 &ndash; Old featured stickers, generic dice, poll timer, poll solution</a></li><li><a href="?layer=113">113 &ndash; PSA</a></li><li><a href="?layer=114">114 &ndash; Video thumbs for GIFs</a></li><li><a href="?layer=115">115 &ndash; Peek Channel Invite</a></li><li><a href="?layer=116">116 &ndash; Group Stats, Profile Videos</a></li><li><a href="?layer=117">117 &ndash; WebRTC Phone Calls</a></li><li><a href="?layer=118">118 &ndash; Callback with 2FA, Countries list</a></li><li><a href="?layer=119">119 &ndash; Comments in channels, Threads, Anonymous Admins</a></li><li><a href="?layer=120">120 &ndash; Multipins, Message Stats, GeoLive v2</a></li><li><a href="?layer=121">121 &ndash; SVG-based Outlines for Stickers</a></li><li><a href="?layer=122">122 &ndash; Voice Chats</a></li><li><a href="?layer=123">123 &ndash; Voice Chat improvements</a></li><li><a href="?layer=124">124 &ndash; Expiring Invite links</a></li><li><a href="?layer=125">125 &ndash; Voice Chats in Broadcasts</a></li><li><a href="?layer=126">126 &ndash; Ban channels in channels</a></li><li><a href="?layer=127">127 &ndash; Payments in channels</a></li><li><a href="?layer=128">128 &ndash; Microthumbs for User/Chat profile photos</a></li><li><a href="?layer=129">129 &ndash; Video Chats</a></li><li><a href="?layer=130">130 &ndash; Custom placeholder for bot reply keyboards</a></li><li><a href="?layer=131">131 &ndash; Reset 2FA Password after a week</a></li><li><a href="?layer=132">132 &ndash; Chat themes</a></li><li><a href="?layer=133">133 &ndash; 64-bit IDs for User/Chat</a></li><li><a href="?layer=134">134 &ndash; Chat Requests, Shared Media Calendar</a></li><li><a href="?layer=135">135 &ndash; Send Message As a Channel</a></li><li><a href="?layer=136">136 &ndash; Reactions</a></li><li><a href="?layer=137">137 &ndash; Translations</a></li><li><a href="?layer=138"><strong>138 &ndash; GIF Sticker Packs</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/inputGroupCallStream" class="current_page_link" >inputGroupCallStream</a>#598a92a flags:<a href="/type/%23" >#</a> call:<a href="/type/InputGroupCall" >InputGroupCall</a> time_ms:<a href="/type/long" >long</a> scale:<a href="/type/int" >int</a> video_channel:flags.0?<a href="/type/int" >int</a> video_quality:flags.0?<a href="/type/int" >int</a> = <a href="/type/InputFileLocation" >InputFileLocation</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>call</strong></td>
<td style="text-align: center;"><a href="/type/InputGroupCall">InputGroupCall</a></td>
<td>Livestream info</td>
</tr>
<tr>
<td><strong>time_ms</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td>
<td>Timestamp in milliseconds</td>
</tr>
<tr>
<td><strong>scale</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Specifies the duration of the video segment to fetch in milliseconds, by bitshifting <code>1000</code> to the right <code>scale</code> times: <code>duration_ms := 1000 &gt;&gt; scale</code></td>
</tr>
<tr>
<td><strong>video_channel</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/int">int</a></td>
<td>Selected video channel</td>
</tr>
<tr>
<td><strong>video_quality</strong></td>
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/int">int</a></td>
<td>Selected video quality (0 = lowest, 1 = medium, 2 = best)</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/InputFileLocation">InputFileLocation</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/blog">Blog</a></li>
<li><a href="//telegram.org/jobs">Jobs</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/dl/android">Android</a></li>
<li><a href="//telegram.org/dl/wp">Windows Phone</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="//core.telegram.org/">Platform</a></h5>
<ul>
<li><a href="//core.telegram.org/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="//core.telegram.org/">Platform</a></h5>
</div>
<div class="footer_column">
<h5><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)">Twitter</a></h5>
</div>
</div>
</div>
</div>
<script src="/js/main.js?43"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,685 @@
var startTime = +(new Date());
function dT() {
return '[' + ((+(new Date()) - startTime)/ 1000.0) + '] ';
}
var jsonpCallbacks = [];
function twitterCustomShareInit () {
var btns = document.querySelectorAll
? document.querySelectorAll('.tl_twitter_share_btn')
: [document.getElementById('tl_twitter_share_btn')];
if (!btns.length) {
return;
}
var head = document.getElementsByTagName('head')[0], i, script;
for (i = 0; i < btns.length; i++) {
(function (btn) {
var status = btn.getAttribute('data-text'),
url = btn.getAttribute('data-url') || location.toString() || 'https://telegram.org/',
via = btn.getAttribute('data-via'),
urlEncoded = encodeURIComponent(url),
popupUrl = 'https://twitter.com/intent/tweet?text=' + encodeURIComponent(status) + '&url=' + urlEncoded + '&via=' + encodeURIComponent(via);
btn.setAttribute('href', popupUrl);
btn.href = popupUrl;
btn.addEventListener('click', function (e) {
var popupW = 550,
popupH = 450,
params = [
'width=' + popupW,
'height=' + popupH,
'left=' + Math.round(screen.width / 2 - popupW / 2),
'top=' + Math.round(screen.height / 2 - popupH / 2),
'personalbar=0',
'toolbar=0',
'scrollbars=1',
'resizable=1'
].join(','),
popup = window.open(popupUrl, '_blank', params);
if (popup) {
try {
popup.focus();
} catch (e) {}
}
return cancelEvent(e);
}, false);
})(btns[i]);
}
}
function blogRecentNewsInit () {
if (document.querySelectorAll) {
var sideImages = document.querySelectorAll('.blog_side_image_wrap');
var sideImage, parent, i;
var len = len = sideImages.length;
for (i = 0; i < len; i++) {
sideImage = sideImages[i];
parent = sideImage.parentNode.parentNode;
if (parent) {
parent.insertBefore(sideImage, parent.firstChild);
}
}
}
var moreBtn = document.getElementById('tlb_blog_head_more_link');
if (!moreBtn) {
return false;
}
var activeClassName = 'tlb_blog_head_recent_active';
moreBtn.addEventListener('click', function (event) {
var parent = this.parentNode;
var className = parent.className;
if (className.indexOf(activeClassName) == -1) {
className += ' ' + activeClassName;
} else {
className = className.replace(' ' + activeClassName, '');
}
parent.className = className;
return cancelEvent(event);
});
}
function blogSideImageUpdate(argument) {
var isDesktop = document.documentElement.offsetWidth >= 1000
document.querySelectorAll('.blog_side_image_wrap').forEach(function (imageWrap) {
if (isDesktop) {
var titleHeight = imageWrap.parentNode.previousElementSibling.clientHeight;
var beforeTitleEl = imageWrap.parentNode.previousElementSibling.previousElementSibling;
if (beforeTitleEl) {
titleHeight += beforeTitleEl.clientHeight;
}
imageWrap.firstElementChild.style.marginTop = (-titleHeight - 8) + 'px';
} else {
imageWrap.firstElementChild.style.marginTop = '';
}
})
}
function blogSideImageInit() {
window.addEventListener('resize', blogSideImageUpdate, false);
setTimeout(blogSideImageUpdate, 0);
}
function cancelEvent (event) {
event = event || window.event;
if (event) event = event.originalEvent || event;
if (event.stopPropagation) event.stopPropagation();
if (event.preventDefault) event.preventDefault();
return false;
}
function trackDlClick (element, event) {
var href = element.getAttribute('href'),
track = element.getAttribute('data-track') || false;
if (!track || !window.ga) {
return;
}
var trackData = track.toString().split('/');
ga('send', 'event', trackData[0], trackData[1], href);
if ((element.getAttribute('target') || '').toLowerCase() != '_blank') {
setTimeout(function() { location.href = href; }, 200);
return false;
}
}
var toTopWrapEl,
toTopEl,
pageContentWrapEl,
curVisible,
curShown = false;
function backToTopInit (labelHtml) {
pageContentWrapEl = document.getElementById('dev_page_content_wrap');
if (!pageContentWrapEl) {
return false;
}
var t = document.createElement('div');
t.innerHTML = '<div class="back_to_top"><i class="icon icon-to-top"></i>' + labelHtml + '</div>';
toTopEl = t.firstChild;
t.innerHTML = '<a class="back_to_top_wrap' + (pageContentWrapEl.classList.contains('is_rtl') ? ' is_rtl' : '') + '" onclick="backToTopGo()"></a>';
toTopWrapEl = t.firstChild;
toTopWrapEl.appendChild(toTopEl);
document.body.appendChild(toTopWrapEl);
if (window.addEventListener) {
window.addEventListener('resize', backToTopResize, false);
window.addEventListener('scroll', backToTopScroll, false);
}
backToTopResize();
}
function backToTopGo () {
window.scroll(0, 0);
backToTopScroll();
}
function backToTopResize () {
var left = getXY(pageContentWrapEl)[0],
dwidth = Math.max(window.innerWidth, document.documentElement.clientWidth, 0),
dheight = Math.max(window.innerHeight, document.documentElement.clientHeight);
curVisible = pageContentWrapEl && left > 130 && dwidth > 640;
toTopWrapEl.style.width = left + 'px';
toTopEl.style.height = dheight + 'px';
backToTopScroll();
}
function backToTopScroll () {
var st = window.pageYOffset || document.body.scrollTop || document.documentElement.scrollTop || document.documentElement.scrollTop;
if ((st > 400 && curVisible) != curShown) {
curShown = !curShown;
if (curShown) {
toTopWrapEl.classList.add('back_to_top_shown');
} else {
toTopWrapEl.classList.remove('back_to_top_shown');
}
}
}
function removePreloadInit() {
if (window.addEventListener) {
window.addEventListener('load', function () {
document.body.classList.remove('preload');
}, false);
} else {
setTimeout(function () {
document.body.classList.remove('preload');
}, 1000)
}
}
function getXY (obj) {
if (!obj) return [0, 0];
var left = 0, top = 0;
if (obj.offsetParent) {
do {
left += obj.offsetLeft;
top += obj.offsetTop;
} while (obj = obj.offsetParent);
}
return [left, top];
}
var onDdBodyClick,
currentDd;
function dropdownClick (element, event) {
var parent = element.parentNode;
var isOpen = (parent.className || '').indexOf('open') > 0;
if (currentDd && currentDd != parent) {
dropdownHide(currentDd);
}
if (!isOpen) {
parent.className = (parent.className || '') + ' open';
if (!onDdBodyClick) {
window.addEventListener('click', dropdownPageClick, false);
}
currentDd = parent;
} else {
dropdownHide(currentDd);
currentDd = false;
}
event.cancelBubble = true;
return false;
}
function dropdownHide (parent) {
parent.className = parent.className.replace(' open', '');
}
function dropdownPageClick (event) {
if (currentDd) {
dropdownHide(currentDd);
currentDd = false;
}
}
function escapeHTML (html) {
html = html || '';
return html.replace(/&/g, '&amp;')
.replace(/>/g, '&gt;')
.replace(/</g, '&lt;')
.replace(/"/g, '&quot;')
.replace(/'/g, '&apos;');
}
function videoTogglePlay(el) {
if (el.paused) {
el.play();
} else {
el.pause();
}
}
function getDevPageNav() {
// console.time('page nav');
var menu = $('<ul class="nav navbar-nav navbar-default"></ul>');
var lastLi = false;
var items = 0;
$('a.anchor').each(function (k, anchor) {
var parentTag = anchor.parentNode.tagName;
var matches = parentTag.match(/^h([34])$/i);
var anchorName = anchor.name;
if (!matches || !anchorName) {
return;
}
anchor.id = anchor.name;
var level = parseInt(matches[1]);
var li = $('<li><a href="#'+ anchorName +'" data-target="#'+ anchorName +'" onmouseenter="showTitleIfOverflows(this)">' + escapeHTML(anchor.nextSibling.textContent) + '</a></li>');
if (level == 3) {
li.appendTo(menu);
lastLi = li;
} else {
// console.log(lastLi);
if (!lastLi) {
return;
}
var subMenu = $('ul', lastLi)[0] || $('<ul class="nav"></ul>').appendTo(lastLi);
// console.log(subMenu);
li.appendTo(subMenu);
}
items++;
});
// console.log(items, menu);
// console.timeEnd('page nav');
if (items < 2) {
return false;
}
return menu;
}
function showTitleIfOverflows(element) {
if (element &&
element.innerText &&
element.scrollWidth &&
element.offsetWidth &&
element.offsetWidth < element.scrollWidth) {
element.setAttribute('title', element.innerText);
}
else if (element.removeAttribute) {
element.removeAttribute('title');
}
}
function initDevPageNav() {
window.hasDevPageNav = true;
var menu = getDevPageNav();
if (!menu) {
return;
}
var sideNavCont = $('#dev_side_nav_cont');
if (!sideNavCont.length) {
sideNavCont = $('#dev_page_content_wrap');
}
var sideNavWrap = $('<div class="dev_side_nav_wrap"></div>').prependTo(sideNavCont);
var sideNav = $('<div class="dev_side_nav"></div>').appendTo(sideNavWrap);
menu.appendTo(sideNav);
$('body').css({position: 'relative'}).scrollspy({ target: '.dev_side_nav' });
$('body').on('activate.bs.scrollspy', function () {
$('.dev_side_nav > ul').affix('checkPosition');
var active_el = $('.dev_side_nav li.active').get(-1);
if (active_el) {
if (active_el.scrollIntoViewIfNeeded) {
active_el.scrollIntoViewIfNeeded();
} else if (active_el.scrollIntoView) {
active_el.scrollIntoView(false);
}
}
});
$('body').trigger('activate.bs.scrollspy');
updateMenuAffix(menu);
}
function updateDevPageNav() {
if (!window.hasDevPageNav) {
return;
}
var menu = getDevPageNav() || $('<ul></ul>');
$('.dev_side_nav > ul').replaceWith(menu);
$('body').scrollspy('refresh');
updateMenuAffix(menu);
}
function updateMenuAffix(menu) {
menu.affix({
offset: {
top: function () {
return $('.dev_side_nav_wrap').offset().top;
},
bottom: function () {
return (this.bottom = $('.footer_wrap').outerHeight(true) + 20)
}
}
})
}
function initScrollVideos(desktop) {
var videos = document.querySelectorAll
? document.querySelectorAll('video.tl_blog_vid_autoplay')
: [];
window.pageVideos = Array.prototype.slice.apply(videos);
if (!pageVideos.length) {
return;
}
window.pageVideosPlaying = {};
var index = 1;
var tgStickersCnt = document.querySelectorAll('.js-tgsticker_image').length;
var preloadVideos = tgStickersCnt ? 0 : 2;
for (var i = 0; i < pageVideos.length; i++) {
var videoEl = pageVideos[i];
videoEl.setAttribute('vindex', index++);
var preloadValue = i >= preloadVideos ? 'metadata' : 'auto';
videoEl.setAttribute('preload', preloadValue);
videoEl.preload = preloadValue;
if (desktop) {
videoEl.removeAttribute('controls');
videoEl.autoplay = false;
videoEl.removeAttribute('autoplay');
} else {
videoEl.autoplay = true;
videoEl.playsinline = true;
videoEl.setAttribute('autoplay', 'autoplay');
videoEl.setAttribute('playsinline', 'playsinline');
}
}
if (!desktop) {
return;
}
window.addEventListener('scroll', checkScrollVideos, false);
window.addEventListener('resize', checkScrollVideos, false);
setTimeout(checkScrollVideos, 1000);
}
function checkScrollVideos() {
var w = window,
d = document,
e = d.documentElement,
g = d.getElementsByTagName('body')[0],
winWidth = w.innerWidth || e.clientWidth || g.clientWidth,
winHeight = w.innerHeight|| e.clientHeight|| g.clientHeight,
scrollTop = e.scrollTop || g.scrollTop || w.pageYOffset;
for (var i = 0; i < pageVideos.length; i++) {
var videoEl = pageVideos[i];
var curIndex = videoEl.getAttribute('vindex');
var posY = getFullOffsetY(videoEl);
var height = videoEl.offsetHeight;
// console.log(scrollTop, winHeight, posY, height);
if (isVisibleEnough(posY, height, scrollTop, winHeight, 0.7, 0.9)) {
if (!pageVideosPlaying[curIndex]) {
pageVideosPlaying[curIndex] = true;
console.log('play', videoEl);
videoEl.play();
}
} else {
if (pageVideosPlaying[curIndex]) {
delete pageVideosPlaying[curIndex];
console.log('pause', videoEl);
videoEl.pause();
}
}
}
}
function isVisibleEnough(boxOffset, boxSize, viewOffset, viewSize, boxThreshold, viewThreshold) {
var boxEnd = boxOffset + boxSize;
var viewEnd = viewOffset + viewSize;
var viewBox = Math.min(viewEnd, boxEnd) - Math.max(boxOffset, viewOffset);
if (viewBox < 0) {
return false;
}
if (viewBox / boxSize > boxThreshold) {
return true;
}
if (viewThreshold && viewBox / viewSize > viewThreshold) {
return true;
}
return false
}
function getFullOffsetY(el) {
var offsetTop = el.offsetTop || 0;
if (el.offsetParent) {
offsetTop += getFullOffsetY(el.offsetParent);
}
return offsetTop;
}
function redraw(el) {
el.offsetTop + 1;
}
function initRipple() {
if (!document.querySelectorAll) return;
var rippleTextFields = document.querySelectorAll('.textfield-item input.form-control');
for (var i = 0; i < rippleTextFields.length; i++) {
(function(rippleTextField) {
function onTextRippleStart(e) {
if (document.activeElement === rippleTextField) return;
var rect = rippleTextField.getBoundingClientRect();
if (e.type == 'touchstart') {
var clientX = e.targetTouches[0].clientX;
} else {
var clientX = e.clientX;
}
var ripple = rippleTextField.parentNode.querySelector('.textfield-item-underline');
var rippleX = (clientX - rect.left) / rippleTextField.offsetWidth * 100;
ripple.style.transition = 'none';
redraw(ripple);
ripple.style.left = rippleX + '%';
ripple.style.right = (100 - rippleX) + '%';
redraw(ripple);
ripple.style.left = '';
ripple.style.right = '';
ripple.style.transition = '';
}
rippleTextField.removeEventListener('mousedown', onTextRippleStart);
rippleTextField.removeEventListener('touchstart', onTextRippleStart);
rippleTextField.addEventListener('mousedown', onTextRippleStart);
rippleTextField.addEventListener('touchstart', onTextRippleStart);
})(rippleTextFields[i]);
}
var rippleHandlers = document.querySelectorAll('.ripple-handler');
for (var i = 0; i < rippleHandlers.length; i++) {
(function(rippleHandler) {
function onRippleStart(e) {
var rippleMask = rippleHandler.querySelector('.ripple-mask');
if (!rippleMask) return;
var rect = rippleMask.getBoundingClientRect();
if (e.type == 'touchstart') {
var clientX = e.targetTouches[0].clientX;
var clientY = e.targetTouches[0].clientY;
} else {
var clientX = e.clientX;
var clientY = e.clientY;
}
var rippleX = (clientX - rect.left) - rippleMask.offsetWidth / 2;
var rippleY = (clientY - rect.top) - rippleMask.offsetHeight / 2;
var ripple = rippleHandler.querySelector('.ripple');
ripple.style.transition = 'none';
redraw(ripple);
ripple.style.transform = 'translate3d(' + rippleX + 'px, ' + rippleY + 'px, 0) scale3d(0.2, 0.2, 1)';
ripple.style.opacity = 1;
redraw(ripple);
ripple.style.transform = 'translate3d(' + rippleX + 'px, ' + rippleY + 'px, 0) scale3d(1, 1, 1)';
ripple.style.transition = '';
function onRippleEnd(e) {
ripple.style.transitionDuration = '.2s';
ripple.style.opacity = 0;
document.removeEventListener('mouseup', onRippleEnd);
document.removeEventListener('touchend', onRippleEnd);
document.removeEventListener('touchcancel', onRippleEnd);
}
document.addEventListener('mouseup', onRippleEnd);
document.addEventListener('touchend', onRippleEnd);
document.addEventListener('touchcancel', onRippleEnd);
}
rippleHandler.removeEventListener('mousedown', onRippleStart);
rippleHandler.removeEventListener('touchstart', onRippleStart);
rippleHandler.addEventListener('mousedown', onRippleStart);
rippleHandler.addEventListener('touchstart', onRippleStart);
})(rippleHandlers[i]);
}
}
function mainInitRetinaVideos() {
var videoEls = document.querySelectorAll('video.video__init_retina');
var isRetina = window.devicePixelRatio >= 1.5;
var videoEl, i, badChildren, j, badChild, sources, sourceEl;
for (i = 0; i < videoEls.length; i++) {
videoEl = videoEls[i];
sources = (videoEl.getAttribute('data-sources')||'').split(',');
sourceEl = document.createElement('source');
sourceEl.type = 'video/mp4';
sourceEl.src = sources[isRetina ? 1 : 0];
videoEl.appendChild(sourceEl);
videoEl.classList.remove('video__init_retina');
videoEl.setAttribute('preload', 'auto');
}
}
function mainInitDemoAutoplay(videoLinkElsSelector) {
var videoLinkEls = document.querySelectorAll(videoLinkElsSelector);
var videoLinkEl, videoEl, i;
for (i = 0; i < videoLinkEls.length; i++) {
videoLinkEl = videoLinkEls[i];
videoEl = videoLinkEl.querySelector('video');
if (!videoEl) {
continue;
}
if (videoEl.readyState > 1) {
mainDemoVideoHover(videoLinkEl, 1);
} else {
videoEl.load();
videoEl.addEventListener('loadeddata', (function(el) {
return function () {
setTimeout(function () {
mainDemoVideoHover(el, 1);
}, 0)
}
})(videoLinkEl), false);
}
}
}
function mainDemoVideoHover(videoLinkEl, isHover) {
var outTimeout = videoLinkEl.outTimeout;
var curIsHover = videoLinkEl.isHover || 0;
if (outTimeout) {
clearTimeout(outTimeout);
}
if (curIsHover == isHover) {
return false;
}
if (!isHover) {
outTimeout = setTimeout(function () {
mainDemoVideoDoHover(videoLinkEl, isHover)
}, 100);
videoLinkEl.outTimeout = outTimeout;
return false;
}
mainDemoVideoDoHover(videoLinkEl, isHover);
}
function mainDemoVideoDoHover(videoLinkEl, isHover) {
delete videoLinkEl.outTimeout;
var videoEl = videoLinkEl.querySelector('video');
if (isHover) {
if (videoEl.readyState > 1) {
videoLinkEl.classList.add('video_play');
videoEl.play();
videoLinkEl.isHover = 1;
}
} else {
videoLinkEl.isHover = 0;
}
if (!videoEl.inited) {
videoEl.inited = true;
// videoEl.onended =
videoEl.addEventListener('ended', function onVideoEnded(e) {
if (videoLinkEl.isHover) {
videoEl.currentTime = 0;
videoEl.play();
} else {
videoEl.pause();
videoEl.currentTime = 0;
videoLinkEl.classList.remove('video_play')
}
}, false);
}
}
function mainInitTgStickers(options) {
options = options || {};
if (!RLottie.isSupported) {
if (options.unsupportedURL) {
if (!getCookie('stel_notgs')) {
setCookie('stel_notgs', 1, 7);
}
location = options.unsupportedURL;
}
return false;
}
document.querySelectorAll('.js-tgsticker_image').forEach(function (imgEl) {
RLottie.init(imgEl, options);
});
}
function setCookie(name, value, days) {
var expires = '';
if (days) {
var date = new Date();
date.setTime(date.getTime() + (days * 86400000));
expires = "; expires=" + date.toUTCString();
}
document.cookie = name + "=" + (value || "") + expires + "; path=/";
}
function getCookie(name) {
var nameEQ = name + '=';
var ca = document.cookie.split(';');
for (var i = 0; i < ca.length; i++) {
var c = ca[i];
while (c.charAt(0) == ' ') {
c = c.substr(1, c.length);
}
if (c.indexOf(nameEQ) == 0) {
return c.substr(nameEQ.length, c.length);
}
}
return null;
}
function mainScrollTo(element) {
if (typeof element === 'string') {
element = document.querySelector(element)
}
if (element) {
window.scroll(0, getFullOffsetY(element));
}
}