Update documentation

This commit is contained in:
Lonami
2025-11-05 20:14:25 +01:00
committed by Lonami Exo
commit 9a95659d62
2930 changed files with 60617 additions and 0 deletions
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>AcceptLoginTokenRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="accept_login_token.html">AcceptLoginTokenRequest</a></li></ul><h1>AcceptLoginTokenRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.acceptLoginToken#e894ad4d token:<a href="../../index.html#bytes">bytes</a> = <a href="../../types/authorization.html">Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import AcceptLoginTokenRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/authorization.html">Authorization</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/authorization.html">Authorization</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>token</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.AcceptLoginTokenRequest(
token=<em>b'arbitrary\x7f data \xfa here'</em>
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+28
View File
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>BindTempAuthKeyRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="bind_temp_auth_key.html">BindTempAuthKeyRequest</a></li></ul><h1>BindTempAuthKeyRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.bindTempAuthKey#cdd42a05 perm_auth_key_id:<a href="../../index.html#long">long</a> nonce:<a href="../../index.html#long">long</a> expires_at:<a href="../../index.html#date">date</a> encrypted_message:<a href="../../index.html#bytes">bytes</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import BindTempAuthKeyRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>perm_auth_key_id</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>nonce</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>expires_at</b></td><td style="text-align:center"><a href="../../index.html#date">date</a></td><td></td></tr><tr><td><b>encrypted_message</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 4 known errors:</p><table><tr><td><code>EncryptedMessageInvalidError</code></td><td>Encrypted message invalid.</td></tr><tr><td><code>InputRequestTooLongError</code></td><td>The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message).</td></tr><tr><td><code>TempAuthKeyEmptyError</code></td><td>No temporary auth key provided.</td></tr><tr><td><code>TimeoutError</code></td><td>A timeout occurred while fetching data from the worker.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.BindTempAuthKeyRequest(
perm_auth_key_id=-12398745604826,
nonce=-12398745604826,
expires_at=datetime.timedelta(minutes=5),
encrypted_message=<em>b'arbitrary\x7f data \xfa here'</em>
))
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CancelCodeRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="cancel_code.html">CancelCodeRequest</a></li></ul><h1>CancelCodeRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.cancelCode#1f040578 phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import CancelCodeRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>PhoneNumberInvalidError</code></td><td>The phone number is invalid.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.CancelCodeRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>
))
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+27
View File
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CheckPaidAuthRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="check_paid_auth.html">CheckPaidAuthRequest</a></li></ul><h1>CheckPaidAuthRequest</h1><p>Both users and bots <strong>may</strong> be able to use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.checkPaidAuth#56e59f9c phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> form_id:<a href="../../index.html#long">long</a> = <a href="../../types/auth/sent_code.html">auth.SentCode</a></pre><button onclick="cp('from telethon.tl.functions.auth import CheckPaidAuthRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/sent_code.html">auth.SentCode</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/sent_code.html">SentCode</a></td><td><a href="../../constructors/auth/sent_code_payment_required.html">SentCodePaymentRequired</a></td></tr><tr><td><a href="../../constructors/auth/sent_code_success.html">SentCodeSuccess</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>form_id</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.CheckPaidAuthRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>,
form_id=-12398745604826
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CheckPasswordRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="check_password.html">CheckPasswordRequest</a></li></ul><h1>CheckPasswordRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.checkPassword#d18b4d16 password:<a href="../../types/input_check_password_srp.html">InputCheckPasswordSRP</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import CheckPasswordRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>password</b></td><td style="text-align:center"><a href="../../types/input_check_password_srp.html">InputCheckPasswordSRP</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>PasswordHashInvalidError</code></td><td>The password (and thus its hash value) you entered is invalid.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.CheckPasswordRequest(
password=types.InputCheckPasswordSRP(
srp_id=-12398745604826,
A=<em>b'arbitrary\x7f data \xfa here'</em>,
M1=<em>b'arbitrary\x7f data \xfa here'</em>
)
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>CheckRecoveryPasswordRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="check_recovery_password.html">CheckRecoveryPasswordRequest</a></li></ul><h1>CheckRecoveryPasswordRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.checkRecoveryPassword#0d36bf79 code:<a href="../../index.html#string">string</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import CheckRecoveryPasswordRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>code</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>PasswordRecoveryExpiredError</code></td><td>The recovery code has expired.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.CheckRecoveryPasswordRequest(
code=<em>'some string here'</em>
))
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>DropTempAuthKeysRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="drop_temp_auth_keys.html">DropTempAuthKeysRequest</a></li></ul><h1>DropTempAuthKeysRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.dropTempAuthKeys#8e48a188 except_auth_keys:<a href="../../index.html#vector">Vector</a>&lt;<a href="../../index.html#long">long</a>&gt; = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import DropTempAuthKeysRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>except_auth_keys</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td>A <span class="tooltip" title="Any iterable that supports len() will work too">list</span> must be supplied.</td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.DropTempAuthKeysRequest(
except_auth_keys=[-12398745604826]
))
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ExportAuthorizationRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="export_authorization.html">ExportAuthorizationRequest</a></li></ul><h1>ExportAuthorizationRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.exportAuthorization#e5bfffcd dc_id:<a href="../../index.html#int">int</a> = <a href="../../types/auth/exported_authorization.html">auth.ExportedAuthorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import ExportAuthorizationRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/exported_authorization.html">auth.ExportedAuthorization</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/auth/exported_authorization.html">ExportedAuthorization</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>dc_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>DcIdInvalidError</code></td><td>This occurs when an authorization is tried to be exported for the same data center one is currently connected to.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ExportAuthorizationRequest(
dc_id=42
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+27
View File
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ExportLoginTokenRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="export_login_token.html">ExportLoginTokenRequest</a></li></ul><h1>ExportLoginTokenRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.exportLoginToken#b7e085fe api_id:<a href="../../index.html#int">int</a> api_hash:<a href="../../index.html#string">string</a> except_ids:<a href="../../index.html#vector">Vector</a>&lt;<a href="../../index.html#long">long</a>&gt; = <a href="../../types/auth/login_token.html">auth.LoginToken</a></pre><button onclick="cp('from telethon.tl.functions.auth import ExportLoginTokenRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/login_token.html">auth.LoginToken</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/login_token.html">LoginToken</a></td><td><a href="../../constructors/auth/login_token_migrate_to.html">LoginTokenMigrateTo</a></td></tr><tr><td><a href="../../constructors/auth/login_token_success.html">LoginTokenSuccess</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>api_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>api_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>except_ids</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td>A <span class="tooltip" title="Any iterable that supports len() will work too">list</span> must be supplied.</td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ExportLoginTokenRequest(
api_id=42,
api_hash=<em>'some string here'</em>,
except_ids=[-12398745604826]
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ImportAuthorizationRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="import_authorization.html">ImportAuthorizationRequest</a></li></ul><h1>ImportAuthorizationRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.importAuthorization#a57a7dad id:<a href="../../index.html#long">long</a> bytes:<a href="../../index.html#bytes">bytes</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import ImportAuthorizationRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>id</b></td><td style="text-align:center"><a href="../../index.html#long">long</a></td><td></td></tr><tr><td><b>bytes</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 2 known errors:</p><table><tr><td><code>AuthBytesInvalidError</code></td><td>The provided authorization is invalid.</td></tr><tr><td><code>UserIdInvalidError</code></td><td>Invalid object ID for a user. Make sure to pass the right types, for instance making sure that the request is designed for users or otherwise look for a different one more suited.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ImportAuthorizationRequest(
id=-12398745604826,
bytes=<em>b'arbitrary\x7f data \xfa here'</em>
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ImportBotAuthorizationRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="import_bot_authorization.html">ImportBotAuthorizationRequest</a></li></ul><h1>ImportBotAuthorizationRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.importBotAuthorization#67a3ff2c flags:<a href="../../index.html#int">int</a> api_id:<a href="../../index.html#int">int</a> api_hash:<a href="../../index.html#string">string</a> bot_auth_token:<a href="../../index.html#string">string</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import ImportBotAuthorizationRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>flags</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>api_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>api_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>bot_auth_token</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 3 known errors:</p><table><tr><td><code>AccessTokenExpiredError</code></td><td>Bot token expired.</td></tr><tr><td><code>AccessTokenInvalidError</code></td><td>The provided token is not valid.</td></tr><tr><td><code>ApiIdInvalidError</code></td><td>The api_id/api_hash combination is invalid.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.auth.AuthMethods.sign_in"><code>client.sign_in()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ImportBotAuthorizationRequest(
flags=42,
api_id=42,
api_hash=<em>'some string here'</em>,
bot_auth_token=<em>'some string here'</em>
))
print(result.stringify())</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+25
View File
@@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ImportLoginTokenRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="import_login_token.html">ImportLoginTokenRequest</a></li></ul><h1>ImportLoginTokenRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.importLoginToken#95ac5ce4 token:<a href="../../index.html#bytes">bytes</a> = <a href="../../types/auth/login_token.html">auth.LoginToken</a></pre><button onclick="cp('from telethon.tl.functions.auth import ImportLoginTokenRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/login_token.html">auth.LoginToken</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/login_token.html">LoginToken</a></td><td><a href="../../constructors/auth/login_token_migrate_to.html">LoginTokenMigrateTo</a></td></tr><tr><td><a href="../../constructors/auth/login_token_success.html">LoginTokenSuccess</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>token</b></td><td style="text-align:center"><a href="../../index.html#bytes">bytes</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 3 known errors:</p><table><tr><td><code>AuthTokenAlreadyAcceptedError</code></td><td>The authorization token was already used.</td></tr><tr><td><code>AuthTokenExpiredError</code></td><td>The provided authorization token has expired and the updated QR-code must be re-scanned.</td></tr><tr><td><code>AuthTokenInvalidError</code></td><td>An invalid authorization token was provided.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ImportLoginTokenRequest(
token=<em>b'arbitrary\x7f data \xfa here'</em>
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ImportWebTokenAuthorizationRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="import_web_token_authorization.html">ImportWebTokenAuthorizationRequest</a></li></ul><h1>ImportWebTokenAuthorizationRequest</h1><p>Both users and bots <strong>may</strong> be able to use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.importWebTokenAuthorization#2db873a9 api_id:<a href="../../index.html#int">int</a> api_hash:<a href="../../index.html#string">string</a> web_auth_token:<a href="../../index.html#string">string</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import ImportWebTokenAuthorizationRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>api_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>api_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>web_auth_token</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ImportWebTokenAuthorizationRequest(
api_id=42,
api_hash=<em>'some string here'</em>,
web_auth_token=<em>'some string here'</em>
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+17
View File
@@ -0,0 +1,17 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>Methods/Auth</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li></ul><h1>Methods/Auth</h1><p>Click <a href="botindex.html">here</a> to view the requests that you can use as a bot.</p><h1>Available items</h1><table><tr><td><a href="accept_login_token.html">AcceptLoginTokenRequest</a></td><td><a href="bind_temp_auth_key.html">BindTempAuthKeyRequest</a></td></tr><tr><td><a href="cancel_code.html">CancelCodeRequest</a></td><td><a href="check_paid_auth.html">CheckPaidAuthRequest</a></td></tr><tr><td><a href="check_password.html">CheckPasswordRequest</a></td><td><a href="check_recovery_password.html">CheckRecoveryPasswordRequest</a></td></tr><tr><td><a href="drop_temp_auth_keys.html">DropTempAuthKeysRequest</a></td><td><a href="export_authorization.html">ExportAuthorizationRequest</a></td></tr><tr><td><a href="export_login_token.html">ExportLoginTokenRequest</a></td><td><a href="import_authorization.html">ImportAuthorizationRequest</a></td></tr><tr><td><a href="import_bot_authorization.html">ImportBotAuthorizationRequest</a></td><td><a href="import_login_token.html">ImportLoginTokenRequest</a></td></tr><tr><td><a href="import_web_token_authorization.html">ImportWebTokenAuthorizationRequest</a></td><td><a href="log_out.html">LogOutRequest</a></td></tr><tr><td><a href="recover_password.html">RecoverPasswordRequest</a></td><td><a href="report_missing_code.html">ReportMissingCodeRequest</a></td></tr><tr><td><a href="request_firebase_sms.html">RequestFirebaseSmsRequest</a></td><td><a href="request_password_recovery.html">RequestPasswordRecoveryRequest</a></td></tr><tr><td><a href="resend_code.html">ResendCodeRequest</a></td><td><a href="reset_authorizations.html">ResetAuthorizationsRequest</a></td></tr><tr><td><a href="reset_login_email.html">ResetLoginEmailRequest</a></td><td><a href="send_code.html">SendCodeRequest</a></td></tr><tr><td><a href="sign_in.html">SignInRequest</a></td><td><a href="sign_up.html">SignUpRequest</a></td></tr></table></div></body></html>
+23
View File
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>LogOutRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="log_out.html">LogOutRequest</a></li></ul><h1>LogOutRequest</h1><p><strong>Both users and bots</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.logOut#3e72ba19 = <a href="../../types/auth/logged_out.html">auth.LoggedOut</a></pre><button onclick="cp('from telethon.tl.functions.auth import LogOutRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/logged_out.html">auth.LoggedOut</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/auth/logged_out.html">LoggedOut</a></td></tr></table><h3>Parameters</h3><p>This request takes no input parameters.</p><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.auth.AuthMethods.log_out"><code>client.log_out()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.LogOutRequest())
print(result.stringify())</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+36
View File
@@ -0,0 +1,36 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RecoverPasswordRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="recover_password.html">RecoverPasswordRequest</a></li></ul><h1>RecoverPasswordRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.recoverPassword#37096c70 flags:# code:<a href="../../index.html#string">string</a> new_settings:flags.0?<a href="../../types/account/password_input_settings.html">account.PasswordInputSettings</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import RecoverPasswordRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>code</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>new_settings</b></td><td style="text-align:center"><a href="../../types/account/password_input_settings.html">account.PasswordInputSettings</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can cause 2 known errors:</p><table><tr><td><code>CodeEmptyError</code></td><td>The provided code is empty.</td></tr><tr><td><code>NewSettingsInvalidError</code></td><td>The new settings are invalid.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.RecoverPasswordRequest(
code=<em>'some string here'</em>,
new_settings=types.account.PasswordInputSettings(
new_algo=types.PasswordKdfAlgoUnknown(),
new_password_hash=<em>b'arbitrary\x7f data \xfa here'</em>,
hint=<em>'some string here'</em>,
email=<em>'some string here'</em>,
new_secure_settings=types.SecureSecretSettings(
secure_algo=types.SecurePasswordKdfAlgoUnknown(),
secure_secret=<em>b'arbitrary\x7f data \xfa here'</em>,
secure_secret_id=-12398745604826
)
)
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+27
View File
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ReportMissingCodeRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="report_missing_code.html">ReportMissingCodeRequest</a></li></ul><h1>ReportMissingCodeRequest</h1><p>Both users and bots <strong>may</strong> be able to use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.reportMissingCode#cb9deff6 phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> mnc:<a href="../../index.html#string">string</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import ReportMissingCodeRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>mnc</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ReportMissingCodeRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>,
mnc=<em>'some string here'</em>
))
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RequestFirebaseSmsRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="request_firebase_sms.html">RequestFirebaseSmsRequest</a></li></ul><h1>RequestFirebaseSmsRequest</h1><p>Both users and bots <strong>may</strong> be able to use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.requestFirebaseSms#8e39261e flags:# phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> safety_net_token:flags.0?<a href="../../index.html#string">string</a> play_integrity_token:flags.2?<a href="../../index.html#string">string</a> ios_push_secret:flags.1?<a href="../../index.html#string">string</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import RequestFirebaseSmsRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>safety_net_token</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>play_integrity_token</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>ios_push_secret</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.RequestFirebaseSmsRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>,
safety_net_token=<em>'some string here'</em>,
play_integrity_token=<em>'some string here'</em>,
ios_push_secret=<em>'some string here'</em>
))
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>RequestPasswordRecoveryRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="request_password_recovery.html">RequestPasswordRecoveryRequest</a></li></ul><h1>RequestPasswordRecoveryRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.requestPasswordRecovery#d897bc66 = <a href="../../types/auth/password_recovery.html">auth.PasswordRecovery</a></pre><button onclick="cp('from telethon.tl.functions.auth import RequestPasswordRecoveryRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/password_recovery.html">auth.PasswordRecovery</a></td></tr></table><p>This type can only be an instance of:</p><table><tr><td><a href="../../constructors/auth/password_recovery.html">PasswordRecovery</a></td></tr></table><h3>Parameters</h3><p>This request takes no input parameters.</p><h1>Known RPC errors</h1><p>This request can cause 2 known errors:</p><table><tr><td><code>PasswordEmptyError</code></td><td>The provided password is empty.</td></tr><tr><td><code>PasswordRecoveryNaError</code></td><td>No email was set, can't recover password via email.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.RequestPasswordRecoveryRequest())
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+27
View File
@@ -0,0 +1,27 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ResendCodeRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="resend_code.html">ResendCodeRequest</a></li></ul><h1>ResendCodeRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.resendCode#cae47523 flags:# phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> reason:flags.0?<a href="../../index.html#string">string</a> = <a href="../../types/auth/sent_code.html">auth.SentCode</a></pre><button onclick="cp('from telethon.tl.functions.auth import ResendCodeRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/sent_code.html">auth.SentCode</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/sent_code.html">SentCode</a></td><td><a href="../../constructors/auth/sent_code_payment_required.html">SentCodePaymentRequired</a></td></tr><tr><td><a href="../../constructors/auth/sent_code_success.html">SentCodeSuccess</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>reason</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can cause 2 known errors:</p><table><tr><td><code>PhoneNumberInvalidError</code></td><td>The phone number is invalid.</td></tr><tr><td><code>SendCodeUnavailableError</code></td><td>Returned when all available options for this type of number were already used (e.g. flash-call, then SMS, then this error might be returned to trigger a second resend).</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.auth.AuthMethods.send_code_request"><code>client.send_code_request()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ResendCodeRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>,
reason=<em>'some string here'</em>
))
print(result.stringify())</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+23
View File
@@ -0,0 +1,23 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ResetAuthorizationsRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="reset_authorizations.html">ResetAuthorizationsRequest</a></li></ul><h1>ResetAuthorizationsRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.resetAuthorizations#9fab0d1a = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.auth import ResetAuthorizationsRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../index.html#bool">Bool</a></td></tr></table><p>This type has no instances available.</p><table></table><h3>Parameters</h3><p>This request takes no input parameters.</p><h1>Known RPC errors</h1><p>This request can cause 1 known error:</p><table><tr><td><code>TimeoutError</code></td><td>A timeout occurred while fetching data from the worker.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ResetAuthorizationsRequest())
print(result)</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+26
View File
@@ -0,0 +1,26 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>ResetLoginEmailRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="reset_login_email.html">ResetLoginEmailRequest</a></li></ul><h1>ResetLoginEmailRequest</h1><p>Both users and bots <strong>may</strong> be able to use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.resetLoginEmail#7e960193 phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> = <a href="../../types/auth/sent_code.html">auth.SentCode</a></pre><button onclick="cp('from telethon.tl.functions.auth import ResetLoginEmailRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/sent_code.html">auth.SentCode</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/sent_code.html">SentCode</a></td><td><a href="../../constructors/auth/sent_code_payment_required.html">SentCodePaymentRequired</a></td></tr><tr><td><a href="../../constructors/auth/sent_code_success.html">SentCodeSuccess</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can't cause any RPC error as far as we know.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.ResetLoginEmailRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+38
View File
@@ -0,0 +1,38 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SendCodeRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="send_code.html">SendCodeRequest</a></li></ul><h1>SendCodeRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.sendCode#a677244f phone_number:<a href="../../index.html#string">string</a> api_id:<a href="../../index.html#int">int</a> api_hash:<a href="../../index.html#string">string</a> settings:<a href="../../types/code_settings.html">CodeSettings</a> = <a href="../../types/auth/sent_code.html">auth.SentCode</a></pre><button onclick="cp('from telethon.tl.functions.auth import SendCodeRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/sent_code.html">auth.SentCode</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/sent_code.html">SentCode</a></td><td><a href="../../constructors/auth/sent_code_payment_required.html">SentCodePaymentRequired</a></td></tr><tr><td><a href="../../constructors/auth/sent_code_success.html">SentCodeSuccess</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>api_id</b></td><td style="text-align:center"><a href="../../index.html#int">int</a></td><td></td></tr><tr><td><b>api_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>settings</b></td><td style="text-align:center"><a href="../../types/code_settings.html">CodeSettings</a></td><td></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 10 known errors:</p><table><tr><td><code>ApiIdInvalidError</code></td><td>The api_id/api_hash combination is invalid.</td></tr><tr><td><code>ApiIdPublishedFloodError</code></td><td>This API id was published somewhere, you can't use it now.</td></tr><tr><td><code>AuthRestartError</code></td><td>Restart the authorization process.</td></tr><tr><td><code>InputRequestTooLongError</code></td><td>The input request was too long. This may be a bug in the library as it can occur when serializing more bytes than it should (like appending the vector constructor code at the end of a message).</td></tr><tr><td><code>PhoneNumberAppSignupForbiddenError</code></td><td>You can't sign up using this app.</td></tr><tr><td><code>PhoneNumberBannedError</code></td><td>The used phone number has been banned from Telegram and cannot be used anymore. Maybe check https://www.telegram.org/faq_spam.</td></tr><tr><td><code>PhoneNumberFloodError</code></td><td>You asked for the code too many times..</td></tr><tr><td><code>PhoneNumberInvalidError</code></td><td>The phone number is invalid.</td></tr><tr><td><code>PhonePasswordFloodError</code></td><td>You have tried logging in too many times.</td></tr><tr><td><code>PhonePasswordProtectedError</code></td><td>This phone is password protected.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.auth.AuthMethods.send_code_request"><code>client.send_code_request()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.SendCodeRequest(
phone_number=<em>'some string here'</em>,
api_id=42,
api_hash=<em>'some string here'</em>,
settings=types.CodeSettings(
allow_flashcall=<strong>True</strong>,
current_number=<strong>True</strong>,
allow_app_hash=<strong>True</strong>,
allow_missed_call=<strong>True</strong>,
allow_firebase=<strong>True</strong>,
unknown_number=<strong>True</strong>,
logout_tokens=[<em>b'arbitrary\x7f data \xfa here'</em>],
token=<em>'some string here'</em>,
app_sandbox=<strong>False</strong>
)
))
print(result.stringify())</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+30
View File
@@ -0,0 +1,30 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SignInRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="sign_in.html">SignInRequest</a></li></ul><h1>SignInRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.signIn#8d52a951 flags:# phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> phone_code:flags.0?<a href="../../index.html#string">string</a> email_verification:flags.1?<a href="../../types/email_verification.html">EmailVerification</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import SignInRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr><tr><td><b>email_verification</b></td><td style="text-align:center"><a href="../../types/email_verification.html">EmailVerification</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can cause 6 known errors:</p><table><tr><td><code>PhoneCodeEmptyError</code></td><td>The phone code is missing.</td></tr><tr><td><code>PhoneCodeExpiredError</code></td><td>The confirmation code has expired.</td></tr><tr><td><code>PhoneCodeInvalidError</code></td><td>The phone code entered was invalid.</td></tr><tr><td><code>PhoneNumberInvalidError</code></td><td>The phone number is invalid.</td></tr><tr><td><code>PhoneNumberUnoccupiedError</code></td><td>The phone number is not yet being used.</td></tr><tr><td><code>SessionPasswordNeededError</code></td><td>Two-steps verification is enabled and a password is required.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.auth.AuthMethods.sign_in"><code>client.sign_in()</code></a> to learn about the parameters and see several code examples on how to use it.</p><p>The method above is the recommended way to do it. If you need more control over the parameters or want to learn how it is implemented, open the details by clicking on the "Details" text.</p><details><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.SignInRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>,
phone_code=<em>'some string here'</em>,
email_verification=types.EmailVerificationCode(
code=<em>'some string here'</em>
)
))
print(result.stringify())</pre></details><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>
+29
View File
@@ -0,0 +1,29 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>SignUpRequest</title>
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link id="style" href="../../css/docs.dark.css" rel="stylesheet">
<script>
document.getElementById("style").href = "../../css/docs."
+ (localStorage.getItem("theme") || "light")
+ ".css";
</script>
<link href="https://fonts.googleapis.com/css?family=Nunito|Source+Code+Pro"
rel="stylesheet">
</head>
<body>
<div id="main_div"><ul class="horizontal"><li><a href="../../index.html">API</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="../index.html">Methods</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="index.html">Auth</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="sign_up.html">SignUpRequest</a></li></ul><h1>SignUpRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
auth.signUp#aac7b717 flags:# no_joined_notifications:flags.0?<a href="../../index.html#true">true</a> phone_number:<a href="../../index.html#string">string</a> phone_code_hash:<a href="../../index.html#string">string</a> first_name:<a href="../../index.html#string">string</a> last_name:<a href="../../index.html#string">string</a> = <a href="../../types/auth/authorization.html">auth.Authorization</a></pre><button onclick="cp('from telethon.tl.functions.auth import SignUpRequest');">Copy import to the clipboard</button><h3>Returns</h3><table><tr><td><a href="../../types/auth/authorization.html">auth.Authorization</a></td></tr></table><p>This type can be an instance of either:</p><table><tr><td><a href="../../constructors/auth/authorization.html">Authorization</a></td><td><a href="../../constructors/auth/authorization_sign_up_required.html">AuthorizationSignUpRequired</a></td></tr></table><h3>Parameters</h3><table><tr><td><b>phone_number</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>phone_code_hash</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>first_name</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>last_name</b></td><td style="text-align:center"><a href="../../index.html#string">string</a></td><td></td></tr><tr><td><b>no_joined_notifications</b></td><td style="text-align:center"><a href="../../index.html#true">flag</a></td><td>This argument defaults to <code>None</code> and can be omitted.</td></tr></table><h1>Known RPC errors</h1><p>This request can cause 9 known errors:</p><table><tr><td><code>FirstNameInvalidError</code></td><td>The first name is invalid.</td></tr><tr><td><code>MemberOccupyPrimaryLocFailedError</code></td><td>Occupation of primary member location failed.</td></tr><tr><td><code>PhoneCodeEmptyError</code></td><td>The phone code is missing.</td></tr><tr><td><code>PhoneCodeExpiredError</code></td><td>The confirmation code has expired.</td></tr><tr><td><code>PhoneCodeInvalidError</code></td><td>The phone code entered was invalid.</td></tr><tr><td><code>PhoneNumberFloodError</code></td><td>You asked for the code too many times..</td></tr><tr><td><code>PhoneNumberInvalidError</code></td><td>The phone number is invalid.</td></tr><tr><td><code>PhoneNumberOccupiedError</code></td><td>The phone number is already in use.</td></tr><tr><td><code>RegIdGenerateFailedError</code></td><td>Failure while generating registration ID.</td></tr></table><p>You can import these from <code>telethon.errors</code>.</p><h1 id="examples">Example</h1><pre><strong>from</strong> telethon.sync <strong>import</strong> TelegramClient
<strong>from</strong> telethon <strong>import</strong> functions, types
<strong>with</strong> TelegramClient(name, api_id, api_hash) <strong>as</strong> client:
result = client(functions.auth.SignUpRequest(
phone_number=<em>'some string here'</em>,
phone_code_hash=<em>'some string here'</em>,
first_name=<em>'some string here'</em>,
last_name=<em>'some string here'</em>,
no_joined_notifications=<strong>True</strong>
))
print(result.stringify())</pre><textarea id="c" class="invisible"></textarea><script>function cp(t){var c=document.getElementById("c");c.value=t;c.select();try{document.execCommand("copy")}catch(e){}}</script></div><script>prependPath = "../../";</script><script src="../../js/search.js"></script></body></html>