Update content of files

This commit is contained in:
GitHub Action 2021-06-26 23:49:50 +00:00
parent a6a877219a
commit fbe5b84350
5 changed files with 641 additions and 0 deletions

View file

@ -0,0 +1,150 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Channels</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="How to handle channels, supergroups, groups, and what&#39;s the difference between them.">
<meta property="og:title" content="Channels">
<meta property="og:image" content="2831d0518f782d1977">
<meta property="og:description" content="How to handle channels, supergroups, groups, and what&#39;s the difference between them.">
<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?212" 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/channel" >Channels</a></li></ul></div>
<h1 id="dev_page_title">Channels</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<h3><a class="anchor" href="#channels-chats--supergroups" id="channels-chats--supergroups" name="channels-chats--supergroups"><i class="anchor-icon"></i></a>Channels, chats &amp; supergroups</h3>
<p><a href="https://telegram.org/tour/channels">Channels</a> are a tool for broadcasting your messages to large audiences. They can have an unlimited number of subscribers, they can be public with a permanent URL and each post in a channel has its own view counter.
Technically, they are represented by <a href="/constructor/channel">channel</a> constructors.</p>
<p><a href="https://telegram.org/tour/groups">Supergroups</a> are a powerful tool for building communities and can support up to 200,000 members each.
Technically, supergroups are actually channels: they are represented by <a href="/constructor/channel">channel</a> constructors, with the <code>megagroup</code> flag set to true.</p>
<p>Channels and supergroup can be created using the <a href="/method/channels.createChannel">channels.createChannel</a> method, by setting the appropriate <code>broadcast</code> or <code>megagroup</code> flags.
Supergroups can also be assigned a <code>geo_point</code> to become <a href="https://telegram.org/blog/contacts-local-groups">geochats</a>.</p>
<p>In previous versions of telegram, only normal groups (represented by <a href="/constructor/chat">chat</a> constructors) could be created using <a href="/method/messages.createChat">messages.createChat</a>: these groups have fewer features, and can only have 200 members at max.</p>
<h3><a class="anchor" href="#migration" id="migration" name="migration"><i class="anchor-icon"></i></a>Migration</h3>
<p>To upgrade a legacy group to a supergroup, <a href="/method/messages.migrateChat">messages.migrateChat</a> can be used.
The <code>chats</code> field of the result will have two objects: </p>
<ul>
<li>A <a href="/constructor/chat">chat</a> constructor with a <code>migrated_to</code> field, indicating the address of the new supergroup</li>
<li>The new <a href="/constructor/channel">channel</a> megagroup constructor</li>
</ul>
<p>When <a href="/method/channels.getFullChannel">getting full info</a> about the migrated channel, the <a href="/constructor/channelFull">channelFull</a> object will have <code>migrated_from_chat_id</code> and <code>migrated_from_max_id</code> fields indicating the original ID of the chat, and the message ID in the original chat at which the group was migrated.</p>
<p>All users of the chat will receive an <a href="/constructor/updateNewMessage">updateNewMessage</a> from the old chat with a <a href="/constructor/messageService">messageService</a> containing a <a href="/constructor/messageActionChatMigrateTo">messageActionChatMigrateTo</a> constructor.</p>
<p>All new messages have to be sent to the new supergroup.</p>
<p>When working with migrated groups clients need to handle loading of the message history (as well as search results et cetera) from both the legacy group and the new supergroup. This is done by merging the two messages lists (requested with different <a href="/type/Peer">Peer</a> values) client side.</p>
<h3><a class="anchor" href="#rights" id="rights" name="rights"><i class="anchor-icon"></i></a>Rights</h3>
<p>Channels, legacy groups and supergroups allow setting <a href="https://telegram.org/blog/permissions-groups-undo">granular permissions</a> both for admins and specific users; channels, supergroups and legacy groups also allow setting global granular permissions for users.</p>
<p>For more info on how to set and modify rights, see <a href="/api/rights">here »</a>.</p>
<h3><a class="anchor" href="#pinned-messages" id="pinned-messages" name="pinned-messages"><i class="anchor-icon"></i></a>Pinned messages</h3>
<p>Telegram allows pinning multiple messages on top in a chat, group, supergroup or channel. </p>
<p>See <a href="/api/pin">here »</a> for more info on pinning and unpinning messages. </p>
<h3><a class="anchor" href="#discussion" id="discussion" name="discussion"><i class="anchor-icon"></i></a>Discussion</h3>
<p>Groups can be associated to a channel as a <a href="https://telegram.org/blog/privacy-discussions-web-bots">discussion group</a>, to allow users to discuss about posts. </p>
<p>For more info on how to set a discussion group in channel, see <a href="/api/discussion">here »</a></p>
<h3><a class="anchor" href="#recent-actions" id="recent-actions" name="recent-actions"><i class="anchor-icon"></i></a>Recent actions</h3>
<p>Both supergroups and channels offer a so-called <a href="https://telegram.org/blog/admin-revolution">admin log</a>, a log of recent relevant supergroup and channel actions, like the modification of group/channel settings or information on behalf of an admin, user kicks and bans, and more.</p>
<p>See <a href="/api/recent-actions">here »</a> for more info.</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="/">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="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?42"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,160 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>inputEncryptedFileBigUploaded</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Assigns a new big encrypted file (over 10Mb in size), saved in parts using the method upload.saveBigFilePart.">
<meta property="og:title" content="inputEncryptedFileBigUploaded">
<meta property="og:image" content="">
<meta property="og:description" content="Assigns a new big encrypted file (over 10Mb in size), saved in parts using the method upload.saveBigFilePart.">
<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?212" 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/inputEncryptedFileBigUploaded" >inputEncryptedFileBigUploaded</a></li></ul></div>
<h1 id="dev_page_title">inputEncryptedFileBigUploaded</h1>
<div id="dev_page_content"><p>Assigns a new big encrypted file (over 10Mb in size), saved in parts using the method <a href="/method/upload.saveBigFilePart">upload.saveBigFilePart</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 121 <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"><strong>121 &ndash; SVG-based Outlines for Stickers</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/inputEncryptedFileBigUploaded" class="current_page_link" >inputEncryptedFileBigUploaded</a>#2dc173c8 id:<a href="/type/long" >long</a> parts:<a href="/type/int" >int</a> key_fingerprint:<a href="/type/int" >int</a> = <a href="/type/InputEncryptedFile" >InputEncryptedFile</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>id</strong></td>
<td style="text-align: center;"><a href="/type/long">long</a></td>
<td>Random file id, created by the client</td>
</tr>
<tr>
<td><strong>parts</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>Number of saved parts</td>
</tr>
<tr>
<td><strong>key_fingerprint</strong></td>
<td style="text-align: center;"><a href="/type/int">int</a></td>
<td>32-bit imprint of the key used to encrypt the file</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/InputEncryptedFile">InputEncryptedFile</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="#uploadsavebigfilepart" id="uploadsavebigfilepart" name="uploadsavebigfilepart"><i class="anchor-icon"></i></a><a href="/method/upload.saveBigFilePart">upload.saveBigFilePart</a></h4>
<p>Saves a part of a large file (over 10Mb in size) to be later passed to one of the methods.</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="/">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="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?42"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,132 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>passwordKdfAlgoUnknown</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="Unknown KDF (most likely, the client is outdated and does not support the specified KDF algorithm)">
<meta property="og:title" content="passwordKdfAlgoUnknown">
<meta property="og:image" content="">
<meta property="og:description" content="Unknown KDF (most likely, the client is outdated and does not support the specified KDF algorithm)">
<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?212" 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/passwordKdfAlgoUnknown" >passwordKdfAlgoUnknown</a></li></ul></div>
<h1 id="dev_page_title">passwordKdfAlgoUnknown</h1>
<div id="dev_page_content"><p>Unknown KDF (most likely, the client is outdated and does not support the specified KDF algorithm)</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 121 <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"><strong>121 &ndash; SVG-based Outlines for Stickers</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/passwordKdfAlgoUnknown" class="current_page_link" >passwordKdfAlgoUnknown</a>#d45ab096 = <a href="/type/PasswordKdfAlgo" >PasswordKdfAlgo</a>;</code></pre></p>
<h3><a class="anchor" href="#parameters" id="parameters" name="parameters"><i class="anchor-icon"></i></a>Parameters</h3>
<p>This constructor does not require any parameters.</p>
<h3><a class="anchor" href="#type" id="type" name="type"><i class="anchor-icon"></i></a>Type</h3>
<p><a href="/type/PasswordKdfAlgo">PasswordKdfAlgo</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="/">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="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?42"></script>
<script>backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

View file

@ -0,0 +1,198 @@
<!DOCTYPE html>
<html class="">
<head>
<meta charset="utf-8">
<title>Getting started with TDLib</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta property="description" content="TDLib is a fully functional Telegram client which takes care of all networking, local storage and data consistency details.…">
<meta property="og:title" content="Getting started with TDLib">
<meta property="og:image" content="">
<meta property="og:description" content="TDLib is a fully functional Telegram client which takes care of all networking, local storage and data consistency details.…">
<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?212" 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=""><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="/tdlib" >Telegram Database Library</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/tdlib/getting-started" >Getting started</a></li></ul></div>
<h1 id="dev_page_title">Getting started with TDLib</h1>
<div id="dev_page_content"><!-- scroll_nav -->
<p><strong>TDLib</strong> is a fully functional Telegram client which takes care of all networking, local storage and data consistency details. In this tutorial we describe the main concepts understanding of which is required for effecient TDLib usage.</p>
<h3><a class="anchor" name="tdlib-interface" href="#tdlib-interface"><i class="anchor-icon"></i></a>TDLib interface</h3>
<p>In this text, <em>Client</em> means an interface for interaction with a TDLib instance and <em>Application</em> means the program that uses TDLib to interact with Telegram.</p>
<p>The main TDLib API is fully-asyncronous. An <em>Application</em> can send a request to TDLib through <code>Client.send</code> method and receive a response asynchronously through the <code>Client.receive</code> method when it becomes available. The exact naming of these methods and the way in which requests are matched with responses is different for different TDLib interfaces, but the concept as a whole remains the same. For example, in <em>TDLib</em> <a href="https://core.telegram.org/tdlib/docs/td__json__client_8h.html"><em>JSON</em></a> interface these methods are called <code>td_json_client_send</code> and <code>td_json_client_receive</code>, and their <em>@extra</em> field should be used to match requests with the corresponding responses.</p>
<p>In a high-level interface used by an <em>Application</em> the matching of responses with corresponding requests is often automated and transformed by some wrapper into a call to a continuation, a callback, a Promise or a Future to simplify the handling of responses.</p>
<p>Aside from responses to requests, an <em>Application</em> receives a lot of important data through incoming <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_update.html"><em>updates</em></a>. <em>Updates</em> are used to pass new data from TDLib to the <em>Application</em> and often control the behavior of the <em>Application</em>, leaving no chance to implement something wrong. The correct handling of <em>updates</em> is crucial for creating an <em>Application</em> that is efficient and works correctly.</p>
<blockquote>
<p>You can find a <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_function.html">list of all available TDLib API methods</a> in our web-documentation. You can also find the descriptions of all available TDLib methods and classes in the <a href="https://github.com/tdlib/td/blob/master/td/generate/scheme/td_api.tl">TDLIB API scheme</a>.</p>
<p>TDLib can be used from any programming language. You can find a lot of examples of TDLib-based frameworks in various programming languages in our <a href="https://github.com/tdlib/td/tree/master/example#readme">examples section</a>.</p>
</blockquote>
<h3><a class="anchor" name="tdlib-glossary" href="#tdlib-glossary"><i class="anchor-icon"></i></a>TDLib glossary</h3>
<p>This section describes the basic notions required for understanding the <em>TDLib API</em>. If you have used the TDLib-based <a href="https://core.telegram.org/bots/api">Telegram Bot API</a> most of them should be already familiar to you.</p>
<p>Telegram is a messenger, so the main object is a <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1message.html"><em>message</em></a>. Each <em>message</em> belongs to some <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat.html">chat</a> and has a unique identifier within that <em>chat</em>. <em>Messages</em> inside a <em>chat</em> should be sorted by that identifier. Telegram supports many different kinds of <em>messages</em>, so a <em>message</em> can have many different kinds of <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_message_content.html"><em>message content</em></a>. Currently there are more than 40 different kinds of <em>message content</em>, for example <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1message_text.html"><em>messageText</em></a> for text messages, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1message_photo.html"><em>messagePhoto</em></a> for photos, or <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1message_screenshot_taken.html"><em>messageScreenshotTaken</em></a> for notifications about screenshots taken by the other party.</p>
<p>A Telegram user is called <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1user.html"><em>user</em></a>. Each <em>user</em> has a unique identifier and a <em>first name</em>, and can also have an optional <em>last name</em>, <em>username</em> and <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1profile_photo.html"><em>profile photo</em></a> among other useful fields. <em>Bot</em> is a special <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1user_type_bot.html">type</a> of <em>user</em> which can be controlled through the <a href="https://core.telegram.org/bots/api">Telegram Bot API</a>.</p>
<p>Each <em>chat</em> has <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_member.html"><em>members</em></a>, i.e. <em>users</em> that immediately receive all <em>messages</em> sent to the <em>chat</em>. Currently there are <strong>6</strong> possible <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_chat_member_status.html">chat member statuses</a> which describe different rights and restrictions a <em>user</em> can have in a <em>chat</em>, ranging from the <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_member_status_creator.html">owner of the chat</a> who has more rights in the <em>chat</em> than any other <em>user</em>, to a <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_member_status_banned.html">user banned in the chat</a> who is <em>banned</em> in the <em>chat</em> and can&#39;t return to it by self or even view <em>chat messages</em>, even if the <em>chat</em> is <em>public</em>.</p>
<p>As noted earlier, each <em>message</em> belongs to a <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat.html">chat</a>. Currently there are <strong>4</strong> different <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_chat_type.html">types</a> of <em>chats</em> on Telegram:</p>
<ul>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_type_private.html">Private chats</a> are ordinary one-to-one chats with another <em>user</em> (or with oneself in the case of the special “Saved messages” chat).</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_type_basic_group.html">Basic groups</a> are basic groups with 0-200 <em>members</em>. Every <em>basic group</em> <em>member</em> has their own copy of the message history, so new <em>basic group</em> <em>members</em> may not see older <em>messages</em> (unless another user forwards their own copy to them).</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_type_supergroup.html">Supergroups</a> are groups with up to 200000 <em>members</em> who share a common message history, so new <em>supergroup</em> <em>members</em> can see all the previously sent <em>messages</em> (unless this is explicitly forbidden by the <em>chat creator</em>). There is a special kind of <em>supergroups</em>, called <em>channels</em>, which can have an unlimited number of members and where only the <em>chat creator</em> and some <em>chat administrators</em> can write. All other <em>chat members</em> can only read <em>channel</em> <em>messages</em>.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_type_secret.html">Secret chats</a> are end-to-end encrypted one-to-one <em>chats</em> with another <em>user</em>, available only on the device which was used to initiate and accept the chat.</li>
</ul>
<p>Each chat has a unique identifier, a <em>title</em> and an optional <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_photo.html">chat photo</a>. Chats comprise sorted lists shown to the user, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_position.html">position</a> in which is determined, roughly speaking, by the time of latest activity. The correct order of chats in chat lists is maintained by TDLib, so the <em>Application</em> only needs to listen to updates that change the <code>chat.positions</code> field and sort all chats by the pair <code>(position.order, chat.id)</code> in a given <code>position.list</code>.</p>
<p><em>Messages</em>, <em>chat photos</em> and many other objects can have a <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1file.html"><em>file</em></a> inside of them. Each <em>file</em> has an identifier and may be available <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1local_file.html">locally</a> on a hard drive or <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1remote_file.html">remotely</a> on a cloud server. A <em>file</em> can be usually <em>downloaded</em> to the local hard drive or <em>uploaded</em> to Telegram cloud servers.</p>
<p><em>Messages</em> with media content like <em>photos</em> or <em>videos</em> can have a short accompanying text called <em>caption</em>. The texts of text messages and media captions can contain fragments, which should be formatted in some unusual way. These fragments are called <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1text_entity.html"><em>text entities</em></a> and the combination of a <em>text</em> and its <em>entities</em> are referred together as a <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1formatted_text.html"><em>formatted text</em></a>.</p>
<p>TDLib sends a lot of important data to the <em>Application</em> through <em>updates</em>. For example, if there is a user unknown to the <em>Application</em>, or some data about a user has changed, then TDLib immediately sends an <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_user.html"><em>updateUser</em></a> to the <em>Application</em>.</p>
<blockquote>
<p>You can find list of all currently available updates <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_update.html">here »</a></p>
</blockquote>
<h3><a class="anchor" name="user-authorization" href="#user-authorization"><i class="anchor-icon"></i></a>User authorization</h3>
<p>Authorization is an example of a behavior, which is controlled by <em>TDLib</em> through <em>updates</em>. Whenever an action is required to proceed with user authorization, the <em>Application</em> receives an <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_authorization_state.html"><em>updateAuthorizationState</em></a> with the description of the current <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_authorization_state.html"><em>AuthorizationState</em></a>. The <em>Application</em> only needs to handle this <em>update</em> appropriately to correctly implement user authorization.</p>
<p>The first <em>authorization state</em> received by the <em>Application</em> is always of the type <code>authorizationStateWaitTdlibParameters</code>. When it is received, the <em>Application</em> should provide parameters for <em>TDLib</em> initialization by calling the <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1set_tdlib_parameters.html"><em>setTdlibParameters</em></a> method. In this method the <em>Application</em> will need to specify, among other parameters:</p>
<ul>
<li>api_id — <em>Application</em> identifier for accessing the Telegram API, which can be obtained at https://my.telegram.org.</li>
<li>api_hash — Hash of the <em>Application</em> identifier for accessing the Telegram API, which can be obtained at https://my.telegram.org.</li>
<li>database_directory — The path to the directory on the local disk where the <em>TDLib</em> database is to be stored; must point to a writable directory.</li>
<li>use_message_database — If set to true, the library will maintain a local cache of <em>chats</em> and <em>messages</em>.</li>
<li>use_secret_chats — If set to true, support for <em>secret chats</em> will be enabled.</li>
<li>system_language_code — IETF language tag of the <em>user</em>&#39;s operating system language, like “en-GB”.</li>
<li>device_model — Model of the device the <em>Application</em> is being run on, like “Samsung X”.</li>
</ul>
<p>After call to <code>setTdlibParameters</code> in case of success <em>Application</em> will receive <code>updateAuthorizationState</code> with new state and just needs to handle that update, nothing should be done explicitly. If <code>setTdlibParameters</code> fails, then authorization state is not changed and the <em>Application</em> should try to handle the current <em>authorization state</em> again.</p>
<p>The second received authorization state is always <code>authorizationStateWaitEncryptionKey</code>. When it is received, the database encryption key should be provided through a call to <code>checkDatabaseEncryptionKey</code>. For most mobile apps, you can provide an empty database encryption key here (<a href="https://github.com/tdlib/td/issues/188#issuecomment-379536139">more info</a>). If user isn&#39;t authorized yet, then some of <code>authorizationStateWaitPhoneNumber</code>, <code>authorizationStateWaitCode</code>, <code>authorizationStateWaitRegistration</code> and <code>authorizationStateWaitPassword</code> <em>authorization states</em> may be received. After completing these authorization steps, the <em>Application</em> will receive <code>authorizationStateReady</code>, meaning that authorization was successful and ordinary requests can be sent now.</p>
<blockquote>
<p>You can find complete examples of <em>user</em> authorization in our <a href="https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/example/java/org/drinkless/tdlib/example/Example.java#L97">Java</a> and <a href="https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/example/csharp/TdExample.cs#L68">C#</a> examples.</p>
</blockquote>
<h3><a class="anchor" name="sending-a-message" href="#sending-a-message"><i class="anchor-icon"></i></a>Sending a message</h3>
<p>To send any kind of <em>message</em>, the <em>Application</em> needs to call the method <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1send_message.html">sendMessage</a> providing a <code>chat identifier</code> and the <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_input_message_content.html">content of the message to be sent</a>. For example, the <em>Application</em> can send a <em>text message</em> using <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1input_message_text.html">inputMessageText</a> class as input message content, a <em>photo</em> using <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1input_message_photo.html">inputMessagePhoto</a> or a <em>location</em> using <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1input_message_location.html">inputMessageLocation</a>. The <em>Application</em> can use <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1input_file_local.html">inputFileLocal</a> as <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_input_file.html">InputFile</a> in these objects to send a local file from the hard drive.</p>
<blockquote>
<p>You can find examples of sending a <em>text message</em> in our <a href="https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/example/java/org/drinkless/tdlib/example/Example.java#L304">Java</a> and <a href="https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/example/csharp/TdExample.cs#L214">C#</a> examples.</p>
</blockquote>
<h3><a class="anchor" name="handling-updates" href="#handling-updates"><i class="anchor-icon"></i></a>Handling updates</h3>
<p>All updates and responses to requests should be handled in the order they are received. Here is a list of the most important updates and how they should be handled:</p>
<ul>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_authorization_state.html">updateAuthorizationState</a> — The handling of this update is essential for correct <a href="#user-authorization">user authorization</a>.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_new_chat.html">updateNewChat</a> — This update is received whenever a new <em>chat</em> is discovered. This update is guaranteed to come before the <em>chat</em> identifier is returned to the <em>Application</em>. So, whenever an <em>Application</em> receives a <code>chat_id</code>, it never needs to use a <code>getChat</code> request to receive the <em>chat</em> object. Instead it should maintain a cache of <em>chats</em> received through this update and take all the necessary data about <em>chats</em> from this cache.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_user.html">updateUser</a> — This update is received whenever a new <em>user</em> has been discovered or some data about a known <em>user</em> has changed. This update is guaranteed to come before the <em>user</em> identifier is returned to the <em>Application</em>. So, whenever an <em>Application</em> receives a <code>user_id</code>, it never needs to use the <code>getUser</code> request to receive the <em>user</em> object. Instead it should maintain a cache of <em>users</em> received through this update and take all the necessary data about <em>users</em> from this cache.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_basic_group.html">updateBasicGroup</a> — This update is received whenever a new <em>basic group</em> has been discovered or some data about a known <em>basic group</em> has changed. This update is guaranteed to come before the <em>basic group</em> identifier is returned to the <em>Application</em>. So, whenever an <em>Application</em> receives a <code>basic_group_id</code>, it never needs to use the <code>getBasicGroup</code> request to receive the <code>basicGroup</code> object. Instead it should maintain a cache of <em>basic groups</em> received through this update and take all the necessary data about <em>basic groups</em> from this cache.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_supergroup.html">updateSupergroup</a> — This update is received whenever a new <em>supergroup</em> has been discovered or some data about a known <em>supergroup</em> has changed. This update is guaranteed to come before the <em>supergroup</em> identifier is returned to the <em>Application</em>. So, whenever an <em>Application</em> receives a <code>supergroup_id</code>, it never needs to use the <code>getSupergroup</code> request to receive the <em>supergroup</em> object. Instead it should maintain a cache of <em>supergroups</em> received through this update and take all the necessary data about <em>supergroups</em> from this cache.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_secret_chat.html">updateSecretChat</a> — This update is received whenever a new <em>secret chat</em> has been discovered or some data about a known <em>secret chat</em> has changed. This update is guaranteed to come before the <em>secret chat</em> identifier is returned to the <em>Application</em>. So, whenever an <em>Application</em> receives a <code>secret_chat_id</code>, it never needs to use the <code>getSecretChat</code> request to receive the <em>secret chat</em> object. Instead it should maintain a cache of <em>secret chats</em> received through this update and take all the necessary data about <em>secret chats</em> from this cache.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_new_message.html">updateNewMessage</a> — This update is received whenever a new incoming or outgoing <em>message</em> is added to a <em>chat</em>.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_message_send_succeeded.html">updateMessageSendSucceeded</a> — This update is received whenever a <em>message</em> is successfully sent.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_message_content.html">updateMessageContent</a> — This update is received whenever the <em>content</em> of a <em>message</em> changes.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_file.html">updateFile</a> — This update is received whenever information about a file is updated. The handling of this update is essential to follow the progress of files being downloaded or uploaded.</li>
<li><a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_title.html">updateChatTitle</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_photo.html">updateChatPhoto</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_permissions.html">updateChatPermissions</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_last_message.html">updateChatLastMessage</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_position.html">updateChatPosition</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_read_inbox.html">updateChatReadInbox</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_read_outbox.html">updateChatReadOutbox</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_reply_markup.html">updateChatReplyMarkup</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_draft_message.html">updateChatDraftMessage</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_notification_settings.html">updateChatNotificationSettings</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_unread_mention_count.html">updateChatUnreadMentionCount</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_default_disable_notification.html">updateChatDefaultDisableNotification</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_is_blocked.html">updateChatIsBlocked</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_is_marked_as_unread.html">updateChatIsMarkedAsUnread</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_has_scheduled_messages.html">updateChatHasScheduledMessages</a>, <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1update_chat_action_bar.html">updateChatActionBar</a> — These updates are received whenever some information about a <em>chat</em> changes, the <em>chats</em> cache should be updated accordingly</li>
</ul>
<blockquote>
<p>For a full list of currently available <em>updates</em> see the documentation for the <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_update.html">Update</a> class.</p>
<p>You can find an example of correct handling of some <em>updates</em> in our <a href="https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/example/java/org/drinkless/tdlib/example/Example.java#L378">Java</a> example.</p>
</blockquote>
<h3><a class="anchor" name="getting-the-lists-of-chats" href="#getting-the-lists-of-chats"><i class="anchor-icon"></i></a>Getting the lists of chats</h3>
<p>Currently there are <strong>3</strong> different types of <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1_chat_list.html">chat lists</a>:<br>- <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_list_main.html">Main chat list</a>.<br>- <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_list_archive.html">Archive chat list</a>.<br>- <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat_list_filter.html">A folder chat list</a>.</p>
<p>The <a href="https://core.telegram.org/tdlib/docs/classtd_1_1td__api_1_1chat.html#a40cebc843050f52a09e2ef471c9091e1">positions</a> of <em>chats</em> in <em>chat lists</em> are managed by TDLib, so the <em>Application</em> only needs to listen to <em>updates</em> that change the <code>chat.positions</code> field, maintain the list of all <em>chats</em>, sorted by the pair <code>(position.order, chat.id)</code> in descending order, and call <code>getChats</code> only if there are not enough known <em>chats</em>. Responses to <code>getChats</code> can be often safely ignored, because if all <em>updates</em> changing <code>chat.positions</code> are processed correctly, then the <em>chat list</em> should already be up to date. Because <em>chats</em> are sorted in descending order of <code>position.order</code>, the first request to <code>getChats</code> should have <code>offset_order == 2^63 - 1 == 9223372036854775807</code> — the maximum possible value that a signed 64-bit integer can have. For optimal performance, the number of returned <em>chats</em> is chosen by TDLib and can be smaller than the specified <em>limit</em>. If the <em>Application</em> needs more <em>chats</em>, it should repeat the request with adjusted <code>offset_order</code> and <code>offset_chat_id</code> parameters.</p>
<blockquote>
<p>You can find an example of retrieving the Main <em>chat list</em> in our <a href="https://github.com/tdlib/td/blob/eb80924dad30af4e6d8385d058bb7e847174df5e/example/java/org/drinkless/tdlib/example/Example.java#L248">Java</a> example.</p>
</blockquote>
<h3><a class="anchor" name="getting-chat-messages" href="#getting-chat-messages"><i class="anchor-icon"></i></a>Getting chat messages</h3>
<p>The <em>Application</em> can use the <code>getChatHistory</code> method to get <em>messages</em> in a <em>chat</em>. The <em>messages</em> will be returned in the reverse chronological order (i.e., in descending order of <code>message_id</code>). The <em>Application</em> can pass <code>from_message_id == 0</code> to get <em>messages</em> from the last <em>message</em>. To get more <em>messages</em> than can be returned in one response, the <em>Application</em> needs to pass the identifier of the last <em>message</em> it has received as <code>from_message_id</code> to next request. For optimal performance, the number of the returned <em>messages</em> is chosen by TDLib and can be smaller than the specified <em>limit</em>. If the <em>Application</em> needs more <em>messages</em>, it needs to adjust the <code>from_message_id</code> parameter and repeat the request.</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="/">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="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?42"></script>
<script src="/js/jquery.min.js?1"></script>
<script src="/js/bootstrap.min.js"></script>
<script>window.initDevPageNav&&initDevPageNav();
backToTopInit("Go up");
removePreloadInit();
</script>
</body>
</html>

File diff suppressed because one or more lines are too long