mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2025-03-14 13:04:31 +01:00
Update content of files
This commit is contained in:
parent
accf8b057e
commit
7ee6d42f64
4 changed files with 15 additions and 10 deletions
|
@ -54,11 +54,15 @@ The <a href="/constructor/help.countriesList">help.countriesList</a> config and
|
|||
<p>Then, a text message containing an authorization code is sent to the user's phone using <a href="/method/auth.sendCode">auth.sendCode</a>.<br>
|
||||
However, this is not always the case, if future auth tokens are used: </p>
|
||||
<h4><a class="anchor" href="#future-auth-tokens" id="future-auth-tokens" name="future-auth-tokens"><i class="anchor-icon"></i></a>Future auth tokens</h4>
|
||||
<p>When invoking <a href="/method/auth.logOut">auth.logOut</a> on a previously authorized session with 2FA enabled, the server may return a <code>future_auth_token</code>, which should be stored in the local database.<br>
|
||||
<p>When invoking <a href="/method/auth.logOut">auth.logOut</a> on a previously authorized session, the server may return a <code>future_auth_token</code>, which should be stored in the local database.<br>
|
||||
A <code>future_auth_token</code> is also contained in the <a href="/constructor/auth.authorization">auth.authorization</a> returned when logging in.<br>
|
||||
At all times, the future auth token database should contain at most 20 tokens: evict older tokens as new tokens are added to stay below this limit.<br>
|
||||
When invoking <a href="/method/auth.sendCode">auth.sendCode</a>, all future auth tokens present in the database should be provided to <code>codeSettings.logout_tokens</code>.<br>
|
||||
If any of the future auth tokens matches the account we're trying to login into and the token hasn't expired, <a href="/method/auth.sendCode">auth.sendCode</a> will directly return a <code>SESSION_PASSWORD_NEEDED</code> RPC error, directly asking the user to <a href="#2fa">enter the 2FA password</a>, without sending any authorization code. </p>
|
||||
If any of the future auth tokens matches the account we're trying to login into and the token hasn't expired:</p>
|
||||
<ul>
|
||||
<li>If <a href="/api/srp">2FA</a> is not enabled, <a href="/method/auth.sendCode">auth.sendCode</a> will is directly return an <a href="/constructor/auth.sentCodeSuccess">auth.sentCodeSuccess</a> constructor with session info, indicating the session is authorized.</li>
|
||||
<li>If <a href="/api/srp">2FA</a> is enabled, <a href="/method/auth.sendCode">auth.sendCode</a> will return a <code>SESSION_PASSWORD_NEEDED</code> RPC error, asking the user to <a href="#2fa">enter the 2FA password</a>, without sending any authorization code. </li>
|
||||
</ul>
|
||||
<p>Otherwise, the system will send an authorization code using the following logic:</p>
|
||||
<h4><a class="anchor" href="#code-types" id="code-types" name="code-types"><i class="anchor-icon"></i></a>Code types</h4>
|
||||
<pre><code><a href='/constructor/codeSettings'>codeSettings</a>#ad253d78 flags:<a href='/type/%23'>#</a> allow_flashcall:flags.0?<a href='/constructor/true'>true</a> current_number:flags.1?<a href='/constructor/true'>true</a> allow_app_hash:flags.4?<a href='/constructor/true'>true</a> allow_missed_call:flags.5?<a href='/constructor/true'>true</a> allow_firebase:flags.7?<a href='/constructor/true'>true</a> logout_tokens:flags.6?<a href='/type/Vector%20t'>Vector</a><<a href='/type/bytes'>bytes</a>> token:flags.8?<a href='/type/string'>string</a> app_sandbox:flags.8?<a href='/type/Bool'>Bool</a> = <a href='/type/CodeSettings'>CodeSettings</a>;
|
||||
|
|
|
@ -49,7 +49,7 @@ An error is characterized by several parameters:</p>
|
|||
<h4><a class="anchor" href="#error-type" id="error-type" name="error-type"><i class="anchor-icon"></i></a>Error Type</h4>
|
||||
<p>A string literal in the form of <code>/[A-Z_0-9]+/</code>, which summarizes the problem. For example, <code>AUTH_KEY_UNREGISTERED</code>. This is an optional parameter.</p>
|
||||
<h4><a class="anchor" href="#error-database" id="error-database" name="error-database"><i class="anchor-icon"></i></a>Error Database</h4>
|
||||
<p>A full machine-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/464001136/11a3d/Z0UdLH0a7_Q.95660.json/07bceab6e1669bfcc2">here »</a>, what follows is a description of its fields: </p>
|
||||
<p>A full machine-readable JSON list of RPC errors that can be returned by all methods in the API can be found <a href="/file/464001752/10896/01di6X_ZJgY.95660.json/4c7223847bba32be0e">here »</a>, what follows is a description of its fields: </p>
|
||||
<ul>
|
||||
<li><code>errors</code> - All error messages and codes for each method (object).<ul>
|
||||
<li>Keys: Error codes as strings (numeric strings)</li>
|
||||
|
|
|
@ -62,14 +62,15 @@
|
|||
<a href='/method/channels.toggleUsername'>channels.toggleUsername</a>#50f24105 channel:<a href='/type/InputChannel'>InputChannel</a> username:<a href='/type/string'>string</a> active:<a href='/type/Bool'>Bool</a> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/channels.reorderUsernames'>channels.reorderUsernames</a>#b45ced1d channel:<a href='/type/InputChannel'>InputChannel</a> order:<a href='/type/Vector%20t'>Vector</a><<a href='/type/string'>string</a>> = <a href='/type/Bool'>Bool</a>;
|
||||
<a href='/method/channels.deactivateAllUsernames'>channels.deactivateAllUsernames</a>#0a245dd3 channel:<a href='/type/InputChannel'>InputChannel</a> = <a href='/type/Bool'>Bool</a>;</code></pre>
|
||||
<p>The ownership of collectible usernames is secured by TON, a fast and scalable blockchain network. They can be bought and sold through the <a href="https://fragment.com">Fragment platform »</a>, giving a simple and secure way to acquire and exchange valuable Telegram domains. </p>
|
||||
<p>Collectible usernames work just like basic <a href="https://t.me/username">@usernames</a>, they appear in Global Search results and have <a href="/api/links#public-username-links">deep links »</a>, just like basic usernames. </p>
|
||||
<p>Clients may associate or dissociate purchased collectible usernames either to the current account by using <a href="/method/account.toggleUsername">account.toggleUsername</a>, <em>or</em> to a <a href="/api/channel">channel or supergroup</a> by using <a href="/method/channels.toggleUsername">channels.toggleUsername</a>.<br>
|
||||
Note that you can't dissociate the basic (non-collectible) username, if any. </p>
|
||||
<p><a href="/method/channels.deactivateAllUsernames">channels.deactivateAllUsernames</a> may also be used to dissociate all collectible usernames associated to a certain supergroup or channel.</p>
|
||||
<p>Use <a href="/method/account.reorderUsernames">account.reorderUsernames</a>/<a href="/method/channels.reorderUsernames">channels.reorderUsernames</a> to change the order of the usernames associated to an account, channel or supergroup.<br>
|
||||
All currently active usernames must be specified: the first specified username should be shown in-UI as the main username. </p>
|
||||
<p>If any collectible username is associated to an account, channel or supergroup, <a href="/constructor/user">user</a>.<code>username</code> and <a href="/constructor/channel">channel</a>.<code>username</code> won't be set, and <a href="/constructor/user">user</a>.<code>usernames</code> and <a href="/constructor/channel">channel</a>.<code>usernames</code> will be set, instead: these fields contain an array of <a href="/constructor/username">username</a> constructors, which indicate whether a certain username is a basic username (<code>editable</code> is set) or a collectible username (<code>editable</code> is not set); and whether a collectible username is <code>active</code> or not.</p></div>
|
||||
<p>The ownership of collectible usernames is secured by TON, a fast and scalable blockchain network. They can be bought and sold through the <a href="https://fragment.com">Fragment platform »</a>, giving a simple and secure way to acquire and exchange valuable Telegram domains. </p>
|
||||
<p>On the Fragment platform, clients may associate or dissociate purchased collectible usernames either to their Telegram account, or to a <a href="/api/channel">channel/supergroup</a> they own. </p>
|
||||
<p>If any collectible username is associated to an account, channel or supergroup, <a href="/constructor/user">user</a>.<code>username</code> and <a href="/constructor/channel">channel</a>.<code>username</code> won't be set, and <a href="/constructor/user">user</a>.<code>usernames</code> and <a href="/constructor/channel">channel</a>.<code>usernames</code> will be set, instead: these fields contain an array of <a href="/constructor/username">username</a> constructors, which indicate whether a certain username is a basic username (<code>editable</code> is set) or a collectible username (<code>editable</code> is not set); and whether a collectible username is <code>active</code> or not.<br>
|
||||
The first username in the <code>usernames</code> vector must be shown in-UI as the main username.</p>
|
||||
<p>Immediately after association, a username is marked as not <code>active</code> (i.e. only the owner can see it in the <code>usernames</code> list): use <a href="/method/account.toggleUsername">account.toggleUsername</a> and <a href="/method/channels.toggleUsername">channels.toggleUsername</a> to mark it as active.<br>
|
||||
Note that you can't mark as not active the basic (non-collectible) username, if any. </p>
|
||||
<p><a href="/method/channels.deactivateAllUsernames">channels.deactivateAllUsernames</a> may also be used to mark as not active all collectible usernames associated to a certain supergroup or channel.</p>
|
||||
<p>Use <a href="/method/account.reorderUsernames">account.reorderUsernames</a>/<a href="/method/channels.reorderUsernames">channels.reorderUsernames</a> to change the order of the usernames associated to an account, channel or supergroup: all currently active usernames must be specified.</p></div>
|
||||
|
||||
</div>
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue