mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-12-11 17:31:02 +01:00
302 lines
38 KiB
HTML
302 lines
38 KiB
HTML
<!DOCTYPE html>
|
||
<html class="">
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<title>Search</title>
|
||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||
<meta property="description" content="Telegram allows applying detailed message filters while looking for messages in chats.">
|
||
<meta property="og:title" content="Search">
|
||
<meta property="og:image" content="">
|
||
<meta property="og:description" content="Telegram allows applying detailed message filters while looking for messages in chats.">
|
||
<link rel="icon" type="image/svg+xml" href="/img/website_icon.svg?4">
|
||
<link rel="apple-touch-icon" sizes="180x180" href="/img/apple-touch-icon.png">
|
||
<link rel="icon" type="image/png" sizes="32x32" href="/img/favicon-32x32.png">
|
||
<link rel="icon" type="image/png" sizes="16x16" href="/img/favicon-16x16.png">
|
||
<link rel="alternate icon" href="/img/favicon.ico" type="image/x-icon" />
|
||
<link href="/css/bootstrap.min.css?3" rel="stylesheet">
|
||
|
||
<link href="/css/telegram.css?240" rel="stylesheet" media="screen">
|
||
<style>
|
||
</style>
|
||
</head>
|
||
<body class="preload">
|
||
<div class="dev_page_wrap">
|
||
<div class="dev_page_head navbar navbar-static-top navbar-tg">
|
||
<div class="navbar-inner">
|
||
<div class="container clearfix">
|
||
<ul class="nav navbar-nav navbar-right hidden-xs"><li class="navbar-twitter"><a href="https://twitter.com/telegram" target="_blank" data-track="Follow/Twitter" onclick="trackDlClick(this, event)"><i class="icon icon-twitter"></i><span> Twitter</span></a></li></ul>
|
||
<ul class="nav navbar-nav">
|
||
<li><a href="//telegram.org/">Home</a></li>
|
||
<li class="hidden-xs"><a href="//telegram.org/faq">FAQ</a></li>
|
||
<li class="hidden-xs"><a href="//telegram.org/apps">Apps</a></li>
|
||
<li class="active"><a href="/api">API</a></li>
|
||
<li class=""><a href="/mtproto">Protocol</a></li>
|
||
<li class=""><a href="/schema">Schema</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="container clearfix">
|
||
<div class="dev_page">
|
||
<div id="dev_page_content_wrap" class=" ">
|
||
<div class="dev_page_bread_crumbs"><ul class="breadcrumb clearfix"><li><a href="/api" >API</a></li><i class="icon icon-breadcrumb-divider"></i><li><a href="/api/search" >Search</a></li></ul></div>
|
||
<h1 id="dev_page_title">Search</h1>
|
||
|
||
<div id="dev_page_content"><!-- scroll_nav -->
|
||
|
||
<p>Telegram allows applying detailed message filters while looking for messages in chats.</p>
|
||
<h3><a class="anchor" href="#search-filters" id="search-filters" name="search-filters"><i class="anchor-icon"></i></a>Search filters</h3>
|
||
<pre><code><a href='/constructor/inputMessagesFilterEmpty'>inputMessagesFilterEmpty</a>#57e2f66c = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterPhotos'>inputMessagesFilterPhotos</a>#9609a51c = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterVideo'>inputMessagesFilterVideo</a>#9fc00e65 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterPhotoVideo'>inputMessagesFilterPhotoVideo</a>#56e9f0e4 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterDocument'>inputMessagesFilterDocument</a>#9eddf188 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterUrl'>inputMessagesFilterUrl</a>#7ef0dd87 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterGif'>inputMessagesFilterGif</a>#ffc86587 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterVoice'>inputMessagesFilterVoice</a>#50f5c392 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterMusic'>inputMessagesFilterMusic</a>#3751b49e = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterChatPhotos'>inputMessagesFilterChatPhotos</a>#3a20ecb8 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterPhoneCalls'>inputMessagesFilterPhoneCalls</a>#80c99768 flags:<a href='/type/%23'>#</a> missed:flags.0?<a href='/constructor/true'>true</a> = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterRoundVoice'>inputMessagesFilterRoundVoice</a>#7a7c17a4 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterRoundVideo'>inputMessagesFilterRoundVideo</a>#b549da53 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterMyMentions'>inputMessagesFilterMyMentions</a>#c1f8e69a = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterGeo'>inputMessagesFilterGeo</a>#e7026d0d = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterContacts'>inputMessagesFilterContacts</a>#e062db83 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
<a href='/constructor/inputMessagesFilterPinned'>inputMessagesFilterPinned</a>#1bb00451 = <a href='/type/MessagesFilter'>MessagesFilter</a>;
|
||
|
||
<a href='/constructor/messages.messages'>messages.messages</a>#8c718e87 messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesSlice'>messages.messagesSlice</a>#3a54685e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> count:<a href='/type/int'>int</a> next_rate:flags.0?<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.channelMessages'>messages.channelMessages</a>#c776ba4e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> pts:<a href='/type/int'>int</a> count:<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> topics:<a href='/type/Vector%20t'>Vector</a><<a href='/type/ForumTopic'>ForumTopic</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesNotModified'>messages.messagesNotModified</a>#74535f21 count:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/messages.search'>messages.search</a>#29ee847a flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> q:<a href='/type/string'>string</a> from_id:flags.0?<a href='/type/InputPeer'>InputPeer</a> saved_peer_id:flags.2?<a href='/type/InputPeer'>InputPeer</a> saved_reaction:flags.3?<a href='/type/Vector%20t'>Vector</a><<a href='/type/Reaction'>Reaction</a>> top_msg_id:flags.1?<a href='/type/int'>int</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> offset_id:<a href='/type/int'>int</a> add_offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> max_id:<a href='/type/int'>int</a> min_id:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
|
||
<a href='/method/messages.searchGlobal'>messages.searchGlobal</a>#4bc6589a flags:<a href='/type/%23'>#</a> broadcasts_only:flags.1?<a href='/constructor/true'>true</a> folder_id:flags.0?<a href='/type/int'>int</a> q:<a href='/type/string'>string</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;</code></pre>
|
||
<p>When using <a href="/method/messages.search">messages.search</a> or <a href="/method/messages.searchGlobal">messages.searchGlobal</a>, a certain message filter may be applied.<br>
|
||
This allows the server to filter messages based on a text query, and even on their type, and this feature is often used by graphical clients to implement features like the chat gallery, chat profile pictures and more.
|
||
Available filters:</p>
|
||
<ul>
|
||
<li><a href="/constructor/inputMessagesFilterPhotos">inputMessagesFilterPhotos</a> - Returns only photos, used for implementing the chat photo gallery, and when scrolling left or right while viewing a photo</li>
|
||
<li><a href="/constructor/inputMessagesFilterVideo">inputMessagesFilterVideo</a> - Returns only videos, used for implementing the chat video gallery, and when scrolling left or right while viewing a video</li>
|
||
<li><a href="/constructor/inputMessagesFilterPhotoVideo">inputMessagesFilterPhotoVideo</a> - Return only videos and photos, used for implementing the chat media gallery</li>
|
||
<li><a href="/constructor/inputMessagesFilterDocument">inputMessagesFilterDocument</a> - Return only videos and photos, used for implementing the chat document gallery</li>
|
||
<li><a href="/constructor/inputMessagesFilterUrl">inputMessagesFilterUrl</a> - Return only messages with links, used for implementing the chat link gallery</li>
|
||
<li><a href="/constructor/inputMessagesFilterGif">inputMessagesFilterGif</a> - Return only GIFs, used for implementing the chat GIF gallery</li>
|
||
<li><a href="/constructor/inputMessagesFilterVoice">inputMessagesFilterVoice</a> - Return only voice messages, used for implementing the chat voice message gallery, and to consecutively play voice messages in a chat</li>
|
||
<li><a href="/constructor/inputMessagesFilterMusic">inputMessagesFilterMusic</a> - Return only music files, used for implementing the chat music gallery</li>
|
||
<li><a href="/constructor/inputMessagesFilterChatPhotos">inputMessagesFilterChatPhotos</a> - Return only chat photos, used to allow scrolling through the profile picture history of a group</li>
|
||
<li><a href="/constructor/inputMessagesFilterPhoneCalls">inputMessagesFilterPhoneCalls</a> - Return only phone calls, used with <a href="/method/messages.searchGlobal">messages.searchGlobal</a> to implement the call tab, with the phone call history</li>
|
||
<li><a href="/constructor/inputMessagesFilterRoundVoice">inputMessagesFilterRoundVoice</a> - Return only round videos and voice messages, used to consecutively play round videos and voice messages in a chat</li>
|
||
<li><a href="/constructor/inputMessagesFilterRoundVideo">inputMessagesFilterRoundVideo</a> - Return only round videos, used to consecutively play round videos in a chat</li>
|
||
<li><a href="/constructor/inputMessagesFilterMyMentions">inputMessagesFilterMyMentions</a> - Return only messages mentioning me, can be used to display the <a href="/api/mentions">mention history</a> or, combined with another filter or query, return only messages that satisfy a certain criteria, and contain a mention.</li>
|
||
<li><a href="/constructor/inputMessagesFilterGeo">inputMessagesFilterGeo</a> - Return only geolocations, is used to fetch all recent valid <a href="/api/live-location">geolocations or live locations</a> sent in a group, to display them all in a single map</li>
|
||
<li><a href="/constructor/inputMessagesFilterContacts">inputMessagesFilterContacts</a> - Return only contacts</li>
|
||
<li><a href="/constructor/inputMessagesFilterPinned">inputMessagesFilterPinned</a> - Returns only <a href="/api/pin">pinned messages</a>, used for implementing the pinned message list</li>
|
||
</ul>
|
||
<p>The returned <a href="/type/messages.Messages">messages.Messages</a> constructors contain parameters for <a href="/api/offsets">pagination</a>, the messages themselves and two <code>offset_id_offset</code>/<code>count</code> parameters that can be used to display a <code>progress/total</code> counter like <code>photo 134 of 200</code>.<br>
|
||
For example, when displaying the chat photo gallery, we could display a <code>photo ${offset_id_offset} of ${count}</code> indicator on top.</p>
|
||
<h4><a class="anchor" href="#search-counters" id="search-counters" name="search-counters"><i class="anchor-icon"></i></a>Search counters</h4>
|
||
<pre><code><a href='/constructor/messages.searchCounter'>messages.searchCounter</a>#e844ebff flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> count:<a href='/type/int'>int</a> = <a href='/type/messages.SearchCounter'>messages.SearchCounter</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/messages.getSearchCounters'>messages.getSearchCounters</a>#1bbcf300 flags:<a href='/type/%23'>#</a> peer:<a href='/type/InputPeer'>InputPeer</a> saved_peer_id:flags.2?<a href='/type/InputPeer'>InputPeer</a> top_msg_id:flags.0?<a href='/type/int'>int</a> filters:<a href='/type/Vector%20t'>Vector</a><<a href='/type/MessagesFilter'>MessagesFilter</a>> = <a href='/type/Vector%20t'>Vector</a><<a href='/type/messages.SearchCounter'>messages.SearchCounter</a>>;</code></pre>
|
||
<p>Chat counters with filters can also be returned without fetching the actual messages, as seen in the schema above.</p>
|
||
<h3><a class="anchor" href="#global-search" id="global-search" name="global-search"><i class="anchor-icon"></i></a>Global search</h3>
|
||
<p>The global search view should be split into multiple tabs:</p>
|
||
<ul>
|
||
<li><a href="#chats-tab">Chats tab</a></li>
|
||
<li><a href="#channels-tab">Channels tab</a></li>
|
||
<li><a href="#apps-tab">Apps tab</a></li>
|
||
<li><a href="#media-tab">Media tab</a></li>
|
||
<li><a href="#downloads-tab">Downloads tab</a></li>
|
||
<li><a href="#links-tab">Links tab</a></li>
|
||
<li><a href="#files-tab">Files tab</a></li>
|
||
<li><a href="#music-tab">Music tab</a></li>
|
||
<li><a href="#voice-messages-tab">Voice messages tab</a></li>
|
||
</ul>
|
||
<h4><a class="anchor" href="#chats-tab" id="chats-tab" name="chats-tab"><i class="anchor-icon"></i></a>Chats tab</h4>
|
||
<pre><code><a href='/constructor/topPeerCategoryCorrespondents'>topPeerCategoryCorrespondents</a>#637b7ed = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
|
||
<a href='/constructor/topPeerCategoryBotsPM'>topPeerCategoryBotsPM</a>#ab661b5b = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
|
||
<a href='/constructor/topPeerCategoryGroups'>topPeerCategoryGroups</a>#bd17a14a = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
|
||
<a href='/constructor/topPeerCategoryChannels'>topPeerCategoryChannels</a>#161d9628 = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
|
||
|
||
<a href='/constructor/contacts.topPeers'>contacts.topPeers</a>#70b772a8 categories:<a href='/type/Vector%20t'>Vector</a><<a href='/type/TopPeerCategoryPeers'>TopPeerCategoryPeers</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
|
||
|
||
<a href='/constructor/messages.messages'>messages.messages</a>#8c718e87 messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesSlice'>messages.messagesSlice</a>#3a54685e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> count:<a href='/type/int'>int</a> next_rate:flags.0?<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.channelMessages'>messages.channelMessages</a>#c776ba4e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> pts:<a href='/type/int'>int</a> count:<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> topics:<a href='/type/Vector%20t'>Vector</a><<a href='/type/ForumTopic'>ForumTopic</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesNotModified'>messages.messagesNotModified</a>#74535f21 count:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/contacts.getTopPeers'>contacts.getTopPeers</a>#973478b6 flags:<a href='/type/%23'>#</a> correspondents:flags.0?<a href='/constructor/true'>true</a> bots_pm:flags.1?<a href='/constructor/true'>true</a> bots_inline:flags.2?<a href='/constructor/true'>true</a> phone_calls:flags.3?<a href='/constructor/true'>true</a> forward_users:flags.4?<a href='/constructor/true'>true</a> forward_chats:flags.5?<a href='/constructor/true'>true</a> groups:flags.10?<a href='/constructor/true'>true</a> channels:flags.15?<a href='/constructor/true'>true</a> bots_app:flags.16?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
|
||
|
||
<a href='/method/messages.searchGlobal'>messages.searchGlobal</a>#4bc6589a flags:<a href='/type/%23'>#</a> broadcasts_only:flags.1?<a href='/constructor/true'>true</a> folder_id:flags.0?<a href='/type/int'>int</a> q:<a href='/type/string'>string</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;</code></pre>
|
||
<p>Contains results (peers and messages) from all private/secret chats, private/public groups, private/public channels, split in the following sections:</p>
|
||
<ul>
|
||
<li><code>Frequent contacts</code>: Contains avatars and names of the most frequently used users, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryCorrespondents">topPeerCategoryCorrespondents</a> category). </li>
|
||
<li><code>Recent</code>: Contains avatars and names of the most frequently used peers (users+chats+channels), sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryCorrespondents">topPeerCategoryCorrespondents</a>, <a href="/constructor/topPeerCategoryBotsPM">topPeerCategoryBotsPM</a>, <a href="/constructor/topPeerCategoryGroups">topPeerCategoryGroups</a>, <a href="/constructor/topPeerCategoryChannels">topPeerCategoryChannels</a> categories). </li>
|
||
</ul>
|
||
<p>Searching when in the "Chats" tab should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a>, replacing the previously mentioned sections with a list of peers (avatar+name) and messages (max one message per peer). </p>
|
||
<h4><a class="anchor" href="#channels-tab" id="channels-tab" name="channels-tab"><i class="anchor-icon"></i></a>Channels tab</h4>
|
||
<pre><code><a href='/constructor/topPeerCategoryChannels'>topPeerCategoryChannels</a>#161d9628 = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
|
||
|
||
<a href='/constructor/contacts.topPeers'>contacts.topPeers</a>#70b772a8 categories:<a href='/type/Vector%20t'>Vector</a><<a href='/type/TopPeerCategoryPeers'>TopPeerCategoryPeers</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
|
||
|
||
<a href='/constructor/messages.chats'>messages.chats</a>#64ff9fd5 chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> = <a href='/type/messages.Chats'>messages.Chats</a>;
|
||
|
||
<a href='/constructor/messages.messages'>messages.messages</a>#8c718e87 messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesSlice'>messages.messagesSlice</a>#3a54685e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> count:<a href='/type/int'>int</a> next_rate:flags.0?<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.channelMessages'>messages.channelMessages</a>#c776ba4e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> pts:<a href='/type/int'>int</a> count:<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> topics:<a href='/type/Vector%20t'>Vector</a><<a href='/type/ForumTopic'>ForumTopic</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesNotModified'>messages.messagesNotModified</a>#74535f21 count:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/contacts.getTopPeers'>contacts.getTopPeers</a>#973478b6 flags:<a href='/type/%23'>#</a> correspondents:flags.0?<a href='/constructor/true'>true</a> bots_pm:flags.1?<a href='/constructor/true'>true</a> bots_inline:flags.2?<a href='/constructor/true'>true</a> phone_calls:flags.3?<a href='/constructor/true'>true</a> forward_users:flags.4?<a href='/constructor/true'>true</a> forward_chats:flags.5?<a href='/constructor/true'>true</a> groups:flags.10?<a href='/constructor/true'>true</a> channels:flags.15?<a href='/constructor/true'>true</a> bots_app:flags.16?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
|
||
|
||
<a href='/method/channels.getChannelRecommendations'>channels.getChannelRecommendations</a>#25a71742 flags:<a href='/type/%23'>#</a> channel:flags.0?<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/messages.Chats'>messages.Chats</a>;
|
||
|
||
<a href='/method/messages.searchGlobal'>messages.searchGlobal</a>#4bc6589a flags:<a href='/type/%23'>#</a> broadcasts_only:flags.1?<a href='/constructor/true'>true</a> folder_id:flags.0?<a href='/type/int'>int</a> q:<a href='/type/string'>string</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
|
||
<a href='/method/bots.getPopularAppBots'>bots.getPopularAppBots</a>#c2510192 offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/bots.PopularAppBots'>bots.PopularAppBots</a>;</code></pre>
|
||
<p>Contains results from private/public channels only, split in the following sections:</p>
|
||
<ul>
|
||
<li><code>Channels you joined</code>: Contains avatars and names of the most frequently used channels, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryChannels">topPeerCategoryChannels</a> category).</li>
|
||
<li><code>Similar channels</code>: Contains avatars and names of recommended public channels, similar to the ones the current user has already joined, fetched using <a href="/method/channels.getChannelRecommendations">channels.getChannelRecommendations</a> without setting the <code>channel</code> flag, see <a href="/api/recommend">here »</a> for more info. </li>
|
||
</ul>
|
||
<p>Searching when in the "Channels" tab should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <code>broadcasts_only</code> flag set, replacing the previously mentioned sections with a list of peers (avatar+name+returned message, max one row per peer). </p>
|
||
<h4><a class="anchor" href="#apps-tab" id="apps-tab" name="apps-tab"><i class="anchor-icon"></i></a>Apps tab</h4>
|
||
<pre><code><a href='/constructor/topPeerCategoryBotsApp'>topPeerCategoryBotsApp</a>#fd9e7bec = <a href='/type/TopPeerCategory'>TopPeerCategory</a>;
|
||
|
||
<a href='/constructor/contacts.topPeers'>contacts.topPeers</a>#70b772a8 categories:<a href='/type/Vector%20t'>Vector</a><<a href='/type/TopPeerCategoryPeers'>TopPeerCategoryPeers</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
|
||
|
||
<a href='/constructor/bots.popularAppBots'>bots.popularAppBots</a>#1991b13b flags:<a href='/type/%23'>#</a> next_offset:flags.0?<a href='/type/string'>string</a> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/bots.PopularAppBots'>bots.PopularAppBots</a>;
|
||
|
||
// Parse only the `users` field of the following constructors (ignoring messages.channelMessages)
|
||
<a href='/constructor/messages.messages'>messages.messages</a>#8c718e87 messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesSlice'>messages.messagesSlice</a>#3a54685e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> count:<a href='/type/int'>int</a> next_rate:flags.0?<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.messagesNotModified'>messages.messagesNotModified</a>#74535f21 count:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
<a href='/constructor/messages.channelMessages'>messages.channelMessages</a>#c776ba4e flags:<a href='/type/%23'>#</a> inexact:flags.1?<a href='/constructor/true'>true</a> pts:<a href='/type/int'>int</a> count:<a href='/type/int'>int</a> offset_id_offset:flags.2?<a href='/type/int'>int</a> messages:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Message'>Message</a>> topics:<a href='/type/Vector%20t'>Vector</a><<a href='/type/ForumTopic'>ForumTopic</a>> chats:<a href='/type/Vector%20t'>Vector</a><<a href='/type/Chat'>Chat</a>> users:<a href='/type/Vector%20t'>Vector</a><<a href='/type/User'>User</a>> = <a href='/type/messages.Messages'>messages.Messages</a>;
|
||
|
||
---functions---
|
||
|
||
<a href='/method/contacts.getTopPeers'>contacts.getTopPeers</a>#973478b6 flags:<a href='/type/%23'>#</a> correspondents:flags.0?<a href='/constructor/true'>true</a> bots_pm:flags.1?<a href='/constructor/true'>true</a> bots_inline:flags.2?<a href='/constructor/true'>true</a> phone_calls:flags.3?<a href='/constructor/true'>true</a> forward_users:flags.4?<a href='/constructor/true'>true</a> forward_chats:flags.5?<a href='/constructor/true'>true</a> groups:flags.10?<a href='/constructor/true'>true</a> channels:flags.15?<a href='/constructor/true'>true</a> bots_app:flags.16?<a href='/constructor/true'>true</a> offset:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> hash:<a href='/type/long'>long</a> = <a href='/type/contacts.TopPeers'>contacts.TopPeers</a>;
|
||
|
||
<a href='/method/bots.getPopularAppBots'>bots.getPopularAppBots</a>#c2510192 offset:<a href='/type/string'>string</a> limit:<a href='/type/int'>int</a> = <a href='/type/bots.PopularAppBots'>bots.PopularAppBots</a>;
|
||
|
||
<a href='/method/messages.searchGlobal'>messages.searchGlobal</a>#4bc6589a flags:<a href='/type/%23'>#</a> broadcasts_only:flags.1?<a href='/constructor/true'>true</a> folder_id:flags.0?<a href='/type/int'>int</a> q:<a href='/type/string'>string</a> filter:<a href='/type/MessagesFilter'>MessagesFilter</a> min_date:<a href='/type/int'>int</a> max_date:<a href='/type/int'>int</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;</code></pre>
|
||
<p>Used to implement the <a href="https://telegram.org/blog/w3-browser-mini-app-store#mini-app-store">Mini App Store</a>. </p>
|
||
<p>Only contains bots with an associated <a href="/api/bots/webapps#main-mini-apps">Main Mini App</a> (i.e. those with the <a href="/constructor/user">user</a>.<code>bot_has_main_app</code> flag set), split in the following sections:</p>
|
||
<ul>
|
||
<li><code>Apps you use</code>: Contains avatars, names and MAU counters (from <a href="/constructor/user">user</a>.<code>bot_active_users</code>) for <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of bots most frequently used by the user, sorted <a href="/api/top-rating">as specified here »</a> (<a href="/constructor/topPeerCategoryBotsApp">topPeerCategoryBotsApp</a> category). </li>
|
||
<li><code>Popular apps</code>: Contains avatars, names and MAU counters of the <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of the bots returned by <a href="/method/bots.getPopularAppBots">bots.getPopularAppBots</a>. </li>
|
||
</ul>
|
||
<p>Searching when in the "Apps" tab should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a>, replacing the previously mentioned sections with a list of avatars, names and MAU counters (from <a href="/constructor/user">user</a>.<code>bot_active_users</code>) for <a href="/api/bots/webapps#main-mini-apps">Main Mini Apps</a> of the returned bots (clients should only use the returned <code>users</code> field, filtering for bots with the <a href="/constructor/user">user</a>.<code>bot_has_main_app</code> flag set). </p>
|
||
<h4><a class="anchor" href="#media-tab" id="media-tab" name="media-tab"><i class="anchor-icon"></i></a>Media tab</h4>
|
||
<p>Searches for photo+video messages. </p>
|
||
<p>Searching should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <a href="/constructor/inputMessagesFilterPhotoVideo">inputMessagesFilterPhotoVideo</a> filter, rendering the results as specified in the <a href="#chats-tab">chats tab</a>. </p>
|
||
<p>Initially, the tab should be populated with the results returned by passing an empty string in <code>q</code>. </p>
|
||
<h4><a class="anchor" href="#downloads-tab" id="downloads-tab" name="downloads-tab"><i class="anchor-icon"></i></a>Downloads tab</h4>
|
||
<p>Contains a locally generated list of recently downloaded media (of any kind) from all peers. </p>
|
||
<p>Searching should locally search within this list. </p>
|
||
<h4><a class="anchor" href="#links-tab" id="links-tab" name="links-tab"><i class="anchor-icon"></i></a>Links tab</h4>
|
||
<p>Searches for messages with links. </p>
|
||
<p>Searching should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <a href="/constructor/inputMessagesFilterUrl">inputMessagesFilterUrl</a> filter, rendering the results as specified in the <a href="#chats-tab">chats tab</a>. </p>
|
||
<p>Initially, the tab should be populated with the results returned by passing an empty string in <code>q</code>. </p>
|
||
<h4><a class="anchor" href="#files-tab" id="files-tab" name="files-tab"><i class="anchor-icon"></i></a>Files tab</h4>
|
||
<p>Searches for messages with files. </p>
|
||
<p>Searching should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <a href="/constructor/inputMessagesFilterDocument">inputMessagesFilterDocument</a> filter, rendering the results as specified in the <a href="#chats-tab">chats tab</a>. </p>
|
||
<p>Initially, the tab should be populated with the results returned by passing an empty string in <code>q</code>. </p>
|
||
<h4><a class="anchor" href="#music-tab" id="music-tab" name="music-tab"><i class="anchor-icon"></i></a>Music tab</h4>
|
||
<p>Searches for music files. </p>
|
||
<p>Searching should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <a href="/constructor/inputMessagesFilterMusic">inputMessagesFilterMusic</a> filter, rendering the results as specified in the <a href="#chats-tab">chats tab</a>. </p>
|
||
<p>Initially, the tab should be populated with the results returned by passing an empty string in <code>q</code>. </p>
|
||
<h4><a class="anchor" href="#voice-messages-tab" id="voice-messages-tab" name="voice-messages-tab"><i class="anchor-icon"></i></a>Voice messages tab</h4>
|
||
<p>Searches for voice messages. </p>
|
||
<p>Searching should invoke <a href="/method/messages.searchGlobal">messages.searchGlobal</a> with the <a href="/constructor/inputMessagesFilterVoice">inputMessagesFilterVoice</a> filter, rendering the results as specified in the <a href="#chats-tab">chats tab</a>. </p>
|
||
<p>Initially, the tab should be populated with the results returned by passing an empty string in <code>q</code>. </p>
|
||
<h3><a class="anchor" href="#global-hashtag-search" id="global-hashtag-search" name="global-hashtag-search"><i class="anchor-icon"></i></a>Global hashtag search</h3>
|
||
<pre><code>---functions---
|
||
|
||
<a href='/method/channels.searchPosts'>channels.searchPosts</a>#d19f987b hashtag:<a href='/type/string'>string</a> offset_rate:<a href='/type/int'>int</a> offset_peer:<a href='/type/InputPeer'>InputPeer</a> offset_id:<a href='/type/int'>int</a> limit:<a href='/type/int'>int</a> = <a href='/type/messages.Messages'>messages.Messages</a>;</code></pre>
|
||
<p>The special <a href="/method/channels.searchPosts">channels.searchPosts</a> method may be used to globally search for posts from public channels (<em>including</em> those we aren't a member of) and stories from public users, channels and groups (<em>including</em> non-contacts and peers we've never seen before), containing a specific hashtag (which should be passed in the <code>hashtag</code> field without the <code>#</code>). </p>
|
||
<p>See <a href="/api/stories#searching-stories">here »</a> for more info on global search for <em>stories</em> (which should <em>not</em> be triggered when using the global search bar, but rather only when clicking on story hashtags and location tags).</p></div>
|
||
|
||
</div>
|
||
|
||
</div>
|
||
</div>
|
||
<div class="footer_wrap">
|
||
<div class="footer_columns_wrap footer_desktop">
|
||
<div class="footer_column footer_column_telegram">
|
||
<h5>Telegram</h5>
|
||
<div class="footer_telegram_description"></div>
|
||
Telegram is a cloud-based mobile and desktop messaging app with a focus on security and speed.
|
||
</div>
|
||
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/faq">About</a></h5>
|
||
<ul>
|
||
<li><a href="//telegram.org/faq">FAQ</a></li>
|
||
<li><a href="//telegram.org/privacy">Privacy</a></li>
|
||
<li><a href="//telegram.org/press">Press</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/apps#mobile-apps">Mobile Apps</a></h5>
|
||
<ul>
|
||
<li><a href="//telegram.org/dl/ios">iPhone/iPad</a></li>
|
||
<li><a href="//telegram.org/android">Android</a></li>
|
||
<li><a href="//telegram.org/dl/web">Mobile Web</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/apps#desktop-apps">Desktop Apps</a></h5>
|
||
<ul>
|
||
<li><a href="//desktop.telegram.org/">PC/Mac/Linux</a></li>
|
||
<li><a href="//macos.telegram.org/">macOS</a></li>
|
||
<li><a href="//telegram.org/dl/web">Web-browser</a></li>
|
||
</ul>
|
||
</div>
|
||
<div class="footer_column footer_column_platform">
|
||
<h5><a href="/">Platform</a></h5>
|
||
<ul>
|
||
<li><a href="/api">API</a></li>
|
||
<li><a href="//translations.telegram.org/">Translations</a></li>
|
||
<li><a href="//instantview.telegram.org/">Instant View</a></li>
|
||
</ul>
|
||
</div>
|
||
</div>
|
||
<div class="footer_columns_wrap footer_mobile">
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/faq">About</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/blog">Blog</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/apps">Apps</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="/">Platform</a></h5>
|
||
</div>
|
||
<div class="footer_column">
|
||
<h5><a href="//telegram.org/press">Press</a></h5>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<script src="/js/main.js?47"></script>
|
||
<script src="/js/jquery.min.js?1"></script>
|
||
<script src="/js/bootstrap.min.js?1"></script>
|
||
|
||
<script>window.initDevPageNav&&initDevPageNav();
|
||
backToTopInit("Go up");
|
||
removePreloadInit();
|
||
</script>
|
||
</body>
|
||
</html>
|
||
|