mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-11-25 08:47:37 +01:00
190 lines
14 KiB
HTML
190 lines
14 KiB
HTML
<!DOCTYPE html>
|
|
<html class="">
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<title>Folders</title>
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta property="description" content="Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.">
|
|
<meta property="og:title" content="Folders">
|
|
<meta property="og:image" content="">
|
|
<meta property="og:description" content="Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists.">
|
|
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
|
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
|
|
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
|
|
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
|
|
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
|
|
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
|
|
|
<link href="/css/telegram.css?235" 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/folders" >Folders</a></li></ul></div>
|
|
<h1 id="dev_page_title">Folders</h1>
|
|
|
|
<div id="dev_page_content"><!-- scroll_nav -->
|
|
|
|
<p>Telegram allows placing chats into folders, based on their type, mute status, or other custom criteria, thanks to folder blacklists and whitelists. </p>
|
|
<h3><a class="anchor" href="#folders" id="folders" name="folders"><i class="anchor-icon"></i></a>Folders</h3>
|
|
<p>In the API, folders are called "dialog filters"; in the UI, they are typically represented as tabs. </p>
|
|
<p>Schema:</p>
|
|
<pre><code><a href='/constructor/dialogFilter'>dialogFilter</a>#7438f7e8 flags:<a href='/type/%23'>#</a> contacts:flags.0?<a href='/constructor/true'>true</a> non_contacts:flags.1?<a href='/constructor/true'>true</a> groups:flags.2?<a href='/constructor/true'>true</a> broadcasts:flags.3?<a href='/constructor/true'>true</a> bots:flags.4?<a href='/constructor/true'>true</a> exclude_muted:flags.11?<a href='/constructor/true'>true</a> exclude_read:flags.12?<a href='/constructor/true'>true</a> exclude_archived:flags.13?<a href='/constructor/true'>true</a> id:<a href='/type/int'>int</a> title:<a href='/type/string'>string</a> emoticon:flags.25?<a href='/type/string'>string</a> pinned_peers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPeer'>InputPeer</a>> include_peers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPeer'>InputPeer</a>> exclude_peers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputPeer'>InputPeer</a>> = <a href='/type/DialogFilter'>DialogFilter</a>;
|
|
<a href='/constructor/dialogFilterDefault'>dialogFilterDefault</a>#363293ae = <a href='/type/DialogFilter'>DialogFilter</a>;
|
|
|
|
<a href='/constructor/dialogFilterSuggested'>dialogFilterSuggested</a>#77744d4a filter:<a href='/type/DialogFilter'>DialogFilter</a> description:<a href='/type/string'>string</a> = <a href='/type/DialogFilterSuggested'>DialogFilterSuggested</a>;
|
|
|
|
<a href='/constructor/updateDialogFilter'>updateDialogFilter</a>#26ffde7d flags:<a href='/type/%23'>#</a> id:<a href='/type/int'>int</a> filter:flags.0?<a href='/type/DialogFilter'>DialogFilter</a> = <a href='/type/Update'>Update</a>;
|
|
<a href='/constructor/updateDialogFilterOrder'>updateDialogFilterOrder</a>#a5d72105 order:<a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>> = <a href='/type/Update'>Update</a>;
|
|
<a href='/constructor/updateDialogFilters'>updateDialogFilters</a>#3504914f = <a href='/type/Update'>Update</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/messages.getDialogFilters'>messages.getDialogFilters</a>#f19ed96d = <a href='/type/Vector%20t'>Vector</a><<a href='/type/DialogFilter'>DialogFilter</a>>;
|
|
<a href='/method/messages.getSuggestedDialogFilters'>messages.getSuggestedDialogFilters</a>#a29cd42c = <a href='/type/Vector%20t'>Vector</a><<a href='/type/DialogFilterSuggested'>DialogFilterSuggested</a>>;
|
|
<a href='/method/messages.updateDialogFilter'>messages.updateDialogFilter</a>#1ad4a04a flags:<a href='/type/%23'>#</a> id:<a href='/type/int'>int</a> filter:flags.0?<a href='/type/DialogFilter'>DialogFilter</a> = <a href='/type/Bool'>Bool</a>;
|
|
<a href='/method/messages.updateDialogFiltersOrder'>messages.updateDialogFiltersOrder</a>#c563c1e4 order:<a href='/type/Vector%20t'>Vector</a><<a href='/type/int'>int</a>> = <a href='/type/Bool'>Bool</a>;
|
|
|
|
<a href='/method/help.getAppConfig'>help.getAppConfig</a>#98914110 = <a href='/type/JSONValue'>JSONValue</a>;</code></pre>
|
|
<p>On startup, clients call:</p>
|
|
<ul>
|
|
<li><a href="/method/messages.getDialogFilters">messages.getDialogFilters</a> to fetch a list of previously configured folders.</li>
|
|
<li><a href="/method/messages.getSuggestedDialogFilters">messages.getSuggestedDialogFilters</a> to fetch a list of suggested folder combinations.</li>
|
|
<li><a href="/method/help.getAppConfig">help.getAppConfig</a> to fetch app-specific configuration parameters. </li>
|
|
</ul>
|
|
<p>The boolean under the <a href="/api/config#dialog-filters-tooltip"><code>dialog_filters_tooltip</code> JSON key</a> in the result of <a href="/method/help.getAppConfig">help.getAppConfig</a> can be used to determine whether a folder tooltip should be presented to the user right away.<br>
|
|
The UI should then show a list of suggested folder combinations. </p>
|
|
<p>Once configuration is finished, apps call <a href="/method/messages.updateDialogFilter">messages.updateDialogFilter</a> to create or update existing folders.<br>
|
|
As per the <a href="/constructor/dialogFilter">dialogFilter</a> constructor, folders have multiple flags that can be combined to determine which chats should be included in (or excluded from) the folder.<br>
|
|
Folders can also have up to <code>dialogs_folder_pinned_limit_*</code> pinned chats, as determined by the <a href="/api/config#client-configuration">client configuration</a>.</p>
|
|
<p>To reorder existing folders, <a href="/method/messages.updateDialogFiltersOrder">messages.updateDialogFiltersOrder</a> should be used with the IDs of the various dialog filters.</p>
|
|
<p>Premium users also have access to a <a href="/constructor/dialogFilterDefault">dialogFilterDefault</a> constructor, used only when reordering folders to indicate the default (all chats) folder. </p>
|
|
<p>To delete folders, use <a href="/method/messages.updateDialogFilter">messages.updateDialogFilter</a> without populating the <code>filter</code> flag field. </p>
|
|
<p>Clients can receive <a href="/constructor/updateDialogFilter">updateDialogFilter</a>, <a href="/constructor/updateDialogFilterOrder">updateDialogFilterOrder</a> updates with new filter information, generated by other clients when modifying folder info.<br>
|
|
Clients can also receive <a href="/constructor/updateDialogFilters">updateDialogFilters</a>, in which case folder info should be refetched manually using <a href="/method/messages.getDialogFilters">messages.getDialogFilters</a>.</p>
|
|
<h3><a class="anchor" href="#peer-folders" id="peer-folders" name="peer-folders"><i class="anchor-icon"></i></a>Peer folders</h3>
|
|
<p>The API also has another method for identifying groups of peers, used by archived chats.</p>
|
|
<p>Schema:</p>
|
|
<pre><code><a href='/constructor/inputFolderPeer'>inputFolderPeer</a>#fbd2c296 peer:<a href='/type/InputPeer'>InputPeer</a> folder_id:<a href='/type/int'>int</a> = <a href='/type/InputFolderPeer'>InputFolderPeer</a>;
|
|
|
|
<a href='/constructor/folderPeer'>folderPeer</a>#e9baa668 peer:<a href='/type/Peer'>Peer</a> folder_id:<a href='/type/int'>int</a> = <a href='/type/FolderPeer'>FolderPeer</a>;
|
|
|
|
<a href='/constructor/updateFolderPeers'>updateFolderPeers</a>#19360dc0 folder_peers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/FolderPeer'>FolderPeer</a>> pts:<a href='/type/int'>int</a> pts_count:<a href='/type/int'>int</a> = <a href='/type/Update'>Update</a>;
|
|
|
|
<a href='/constructor/updates'>updates</a>#74ae4240 updates:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Update'>Update</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> date:<a href='/type/int'>int</a> seq:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;
|
|
|
|
|
|
<a href='/constructor/inputDialogPeer'>inputDialogPeer</a>#fcaafeb7 peer:<a href='/type/InputPeer'>InputPeer</a> = <a href='/type/InputDialogPeer'>InputDialogPeer</a>;
|
|
<a href='/constructor/inputDialogPeerFolder'>inputDialogPeerFolder</a>#64600527 folder_id:<a href='/type/int'>int</a> = <a href='/type/InputDialogPeer'>InputDialogPeer</a>;
|
|
|
|
<a href='/constructor/dialogPeer'>dialogPeer</a>#e56dbf05 peer:<a href='/type/Peer'>Peer</a> = <a href='/type/DialogPeer'>DialogPeer</a>;
|
|
<a href='/constructor/dialogPeerFolder'>dialogPeerFolder</a>#514519e2 folder_id:<a href='/type/int'>int</a> = <a href='/type/DialogPeer'>DialogPeer</a>;
|
|
|
|
---functions---
|
|
|
|
<a href='/method/folders.editPeerFolders'>folders.editPeerFolders</a>#6847d0ab folder_peers:<a href='/type/Vector%20t'>Vector</a><<a href='/type/InputFolderPeer'>InputFolderPeer</a>> = <a href='/type/Updates'>Updates</a>;
|
|
<a href='/method/folders.deleteFolder'>folders.deleteFolder</a>#1c295881 folder_id:<a href='/type/int'>int</a> = <a href='/type/Updates'>Updates</a>;</code></pre>
|
|
<p>API peer folders are typically used only by <a href="https://telegram.org/blog/archive-and-new-design">archived chats</a>, and are really handy for distinguishing groups of peers, since most peer-related constructors (updates, chat info) will contain the <code>folder_id</code> assigned the the specified chat. </p>
|
|
<p>In Telegram apps, API peer folders are used only to implement the chat archive, identified by <code>folder_id</code> <code>1</code>; all other peers are in <code>folder_id</code> <code>0</code> by default; no other <code>folder_id</code> is allowed at the moment.</p>
|
|
<ul>
|
|
<li><a href="/method/folders.editPeerFolders">folders.editPeerFolders</a> can be used to add and remove peers from peer folders.</li>
|
|
<li><a href="/method/folders.deleteFolder">folders.deleteFolder</a> can be used to delete peer folders, moving all peers previously present in that folder to the default <code>0</code> folder.</li>
|
|
</ul>
|
|
<p>Both methods return an <a href="/constructor/updates">updates</a> constructor, containing a single <a href="/constructor/updateFolderPeers">updateFolderPeers</a> with the new <code>folder_id</code> of moved peers.<br>
|
|
Clients can also receive <a href="/constructor/updateFolderPeers">updateFolderPeers</a> as a normal <a href="/api/updates">update</a>, generated by other clients when modifying peer folders.</p>
|
|
<p>Clients can then use <a href="/type/InputDialogPeer">InputDialogPeer</a> to refer either to a specific chat, or to all chats in a peer folder: the server will return a <a href="/type/DialogPeer">DialogPeer</a> in certain constructors for the same purpose. </p></div>
|
|
|
|
</div>
|
|
|
|
</div>
|
|
</div>
|
|
<div class="footer_wrap">
|
|
<div class="footer_columns_wrap footer_desktop">
|
|
<div class="footer_column footer_column_telegram">
|
|
<h5>Telegram</h5>
|
|
<div class="footer_telegram_description"></div>
|
|
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
|
|
</div>
|
|
|
|
<div class="footer_column">
|
|
<h5><a href="//telegram.org/faq">About</a></h5>
|
|
<ul>
|
|
<li><a href="//telegram.org/faq">FAQ</a></li>
|
|
<li><a href="//telegram.org/privacy">Privacy</a></li>
|
|
<li><a href="//telegram.org/press">Press</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer_column">
|
|
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
|
|
<ul>
|
|
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
|
|
<li><a href="//telegram.org/android">Android</a></li>
|
|
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer_column">
|
|
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
|
|
<ul>
|
|
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
|
|
<li><a href="//macos.telegram.org/">macOS</a></li>
|
|
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
|
|
</ul>
|
|
</div>
|
|
<div class="footer_column footer_column_platform">
|
|
<h5><a href="/">Platform</a></h5>
|
|
<ul>
|
|
<li><a href="/api">API</a></li>
|
|
<li><a href="//translations.telegram.org/">Translations</a></li>
|
|
<li><a href="//instantview.telegram.org/">Instant View</a></li>
|
|
</ul>
|
|
</div>
|
|
</div>
|
|
<div class="footer_columns_wrap footer_mobile">
|
|
<div class="footer_column">
|
|
<h5><a href="//telegram.org/faq">About</a></h5>
|
|
</div>
|
|
<div class="footer_column">
|
|
<h5><a href="//telegram.org/blog">Blog</a></h5>
|
|
</div>
|
|
<div class="footer_column">
|
|
<h5><a href="//telegram.org/apps">Apps</a></h5>
|
|
</div>
|
|
<div class="footer_column">
|
|
<h5><a href="/">Platform</a></h5>
|
|
</div>
|
|
<div class="footer_column">
|
|
<h5><a href="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?47"></script>
|
|
<script src="/js/jquery.min.js?1"></script>
|
|
<script src="/js/bootstrap.min.js?1"></script>
|
|
|
|
<script>window.initDevPageNav&&initDevPageNav();
|
|
backToTopInit("Go up");
|
|
removePreloadInit();
|
|
</script>
|
|
</body>
|
|
</html>
|
|
|