mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-01-06 02:45:30 +01:00
Update content of files
This commit is contained in:
parent
b2832f97ae
commit
13f8dd9279
6 changed files with 13 additions and 12 deletions
|
@ -46,7 +46,7 @@
|
|||
|
||||
<p>Many constructors in the API need to be stored in a local database upon reception and should only ever be updated reactively (passively) when received via updates or by other means (as specified in the documentation), to avoid overloading the server by continuously requesting changes for the same unchanged information. </p>
|
||||
<p><a href="/constructor/user">user</a>, <a href="/constructor/chat">chat</a>, <a href="/constructor/channel">channel</a> constructors and their full counterparts <a href="/constructor/userFull">userFull</a>, <a href="/constructor/chatFull">chatFull</a>, <a href="/constructor/channelFull">channelFull</a> are especially important, because they contain important information about users, bots, chats and channels (from now on, <em>peers</em>), and most importantly the <code>access_hash</code> value, <strong>required</strong> to interact with peers in the API. </p>
|
||||
<p>This page describes exactly how and when should the local databases of the constructors listed above be refreshed. </p>
|
||||
<p>This page describes exactly how and when should the local databases of the constructors listed above be refreshed, and contains a more detailed description of basic peer-related concepts. </p>
|
||||
<blockquote>
|
||||
<p>For simplicity, the documentation often uses the term "cache" instead of "database" when referring to the peer database, however note that the peer database is <strong>not</strong> an ephemeral cache: peer information (or at the very least the id+access hash) must be persisted to a database and <strong>never deleted</strong>, to avoid losing access to the API, which <strong>requires</strong> the locally stored access hash to call methods. </p>
|
||||
</blockquote>
|
||||
|
|
|
@ -194,12 +194,12 @@
|
|||
<tr>
|
||||
<td><strong>id</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/long">long</a></td>
|
||||
<td>ID of the channel</td>
|
||||
<td>ID of the channel, see <a href="/api/peers#peer-id">here »</a> for more info</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>access_hash</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.13?<a href="/type/long">long</a></td>
|
||||
<td>Access hash</td>
|
||||
<td>Access hash, see <a href="/api/peers#access-hash">here »</a> for more info</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>title</strong></td>
|
||||
|
|
|
@ -104,7 +104,7 @@
|
|||
<tr>
|
||||
<td><strong>id</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/long">long</a></td>
|
||||
<td>ID of the group</td>
|
||||
<td>ID of the group, see <a href="/api/peers#peer-id">here »</a> for more info</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>title</strong></td>
|
||||
|
|
|
@ -201,12 +201,12 @@
|
|||
<tr>
|
||||
<td><strong>id</strong></td>
|
||||
<td style="text-align: center;"><a href="/type/long">long</a></td>
|
||||
<td>ID of the user</td>
|
||||
<td>ID of the user, see <a href="/api/peers#peer-id">here »</a> for more info.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>access_hash</strong></td>
|
||||
<td style="text-align: center;"><a href="/mtproto/TL-combinators#conditional-fields">flags</a>.0?<a href="/type/long">long</a></td>
|
||||
<td>Access hash of the user. <br>If this flag is set, when updating the <a href="/api/peers">local peer database</a>, generate a virtual flag called <code>min_access_hash</code>, which is: <br>- Set to <code>true</code> if <code>min</code> is set AND <br> - The <code>phone</code> <em>flag</em> is <strong>not</strong> set OR <br> - The <code>phone</code> <em>flag</em> is set and the associated phone number string is <strong>non-empty</strong> <br>- Set to <code>false</code> otherwise. <br><br>Then, apply both <code>access_hash</code> and <code>min_access_hash</code> to the local database if: <br>- <code>min_access_hash</code> is false OR <br>- <code>min_access_hash</code> is true AND <br> - There is no locally cached object for this user OR <br> - There is no <code>access_hash</code> in the local cache OR <br> - The cached object's <code>min_access_hash</code> is also true <br>If the final merged object stored to the database has the <code>min_access_hash</code> field set to true, the related <code>access_hash</code> is <strong>only</strong> suitable to use in <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> »</a>, to directly <a href="/api/files">download the profile pictures</a> of users, everywhere else a <code>inputPeer*FromMessage</code> constructor will have to be generated as specified <a href="/api/min">here »</a>. <br>Bots can also use min access hashes in some conditions, by passing <code>0</code> instead of the min access hash.</td>
|
||||
<td>Access hash of the user, see <a href="/api/peers#access-hash">here »</a> for more info. <br>If this flag is set, when updating the <a href="/api/peers">local peer database</a>, generate a virtual flag called <code>min_access_hash</code>, which is: <br>- Set to <code>true</code> if <code>min</code> is set AND <br> - The <code>phone</code> <em>flag</em> is <strong>not</strong> set OR <br> - The <code>phone</code> <em>flag</em> is set and the associated phone number string is <strong>non-empty</strong> <br>- Set to <code>false</code> otherwise. <br><br>Then, apply both <code>access_hash</code> and <code>min_access_hash</code> to the local database if: <br>- <code>min_access_hash</code> is false OR <br>- <code>min_access_hash</code> is true AND <br> - There is no locally cached object for this user OR <br> - There is no <code>access_hash</code> in the local cache OR <br> - The cached object's <code>min_access_hash</code> is also true <br>If the final merged object stored to the database has the <code>min_access_hash</code> field set to true, the related <code>access_hash</code> is <strong>only</strong> suitable to use in <a href="/constructor/inputPeerPhotoFileLocation"><code>inputPeerPhotoFileLocation</code> »</a>, to directly <a href="/api/files">download the profile pictures</a> of users, everywhere else a <code>inputPeer*FromMessage</code> constructor will have to be generated as specified <a href="/api/min">here »</a>. <br>Bots can also use min access hashes in some conditions, by passing <code>0</code> instead of the min access hash.</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<td><strong>first_name</strong></td>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<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="/type/InputChannel" >InputChannel</a></li></ul></div>
|
||||
<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="/type/inputChannel" >InputChannel</a></li></ul></div>
|
||||
<h1 id="dev_page_title">InputChannel</h1>
|
||||
|
||||
<div id="dev_page_content"><p>Represents a channel</p>
|
||||
|
@ -55,9 +55,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<pre class="page_scheme"><code><a href="/constructor/inputChannelEmpty" >inputChannelEmpty</a>#ee8c1e86 = <a href="/type/InputChannel" class="current_page_link" >InputChannel</a>;
|
||||
<a href="/constructor/inputChannel" >inputChannel</a>#f35aec28 channel_id:<a href="/type/long" >long</a> access_hash:<a href="/type/long" >long</a> = <a href="/type/InputChannel" class="current_page_link" >InputChannel</a>;
|
||||
<a href="/constructor/inputChannelFromMessage" >inputChannelFromMessage</a>#5b934f9d peer:<a href="/type/InputPeer" >InputPeer</a> msg_id:<a href="/type/int" >int</a> channel_id:<a href="/type/long" >long</a> = <a href="/type/InputChannel" class="current_page_link" >InputChannel</a>;</code></pre></p>
|
||||
<pre class="page_scheme"><code></code></pre></p>
|
||||
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
|
@ -39,7 +39,7 @@
|
|||
<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="/type/inputUser" >InputUser</a></li></ul></div>
|
||||
<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="/type/InputUser" >InputUser</a></li></ul></div>
|
||||
<h1 id="dev_page_title">InputUser</h1>
|
||||
|
||||
<div id="dev_page_content"><p>Defines a user for subsequent interaction.</p>
|
||||
|
@ -55,7 +55,10 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<pre class="page_scheme"><code></code></pre></p>
|
||||
<pre class="page_scheme"><code><a href="/constructor/inputUserEmpty" >inputUserEmpty</a>#b98886cf = <a href="/type/InputUser" class="current_page_link" >InputUser</a>;
|
||||
<a href="/constructor/inputUserSelf" >inputUserSelf</a>#f7c1b13f = <a href="/type/InputUser" class="current_page_link" >InputUser</a>;
|
||||
<a href="/constructor/inputUser" >inputUser</a>#f21158c6 user_id:<a href="/type/long" >long</a> access_hash:<a href="/type/long" >long</a> = <a href="/type/InputUser" class="current_page_link" >InputUser</a>;
|
||||
<a href="/constructor/inputUserFromMessage" >inputUserFromMessage</a>#1da448e2 peer:<a href="/type/InputPeer" >InputPeer</a> msg_id:<a href="/type/int" >int</a> user_id:<a href="/type/long" >long</a> = <a href="/type/InputUser" class="current_page_link" >InputUser</a>;</code></pre></p>
|
||||
<h3><a class="anchor" href="#constructors" id="constructors" name="constructors"><i class="anchor-icon"></i></a>Constructors</h3>
|
||||
<table class="table">
|
||||
<thead>
|
||||
|
|
Loading…
Reference in a new issue