mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2024-11-26 11:23:46 +03:00
40 lines
4.4 KiB
HTML
40 lines
4.4 KiB
HTML
|
<!DOCTYPE html>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
|
||
|
<title>UpdatePasswordSettingsRequest</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">Account</a></li><img src="../../img/arrow.svg" alt="/" /><li><a href="update_password_settings.html">UpdatePasswordSettingsRequest</a></li></ul><h1>UpdatePasswordSettingsRequest</h1><p><strong>Only users</strong> can use this request. <a href="#examples">See code examples.</a></p><pre>---functions---
|
||
|
account.updatePasswordSettings#a59b102f password:<a href="../../types/input_check_password_srp.html">InputCheckPasswordSRP</a> new_settings:<a href="../../types/account/password_input_settings.html">account.PasswordInputSettings</a> = <a href="../../index.html#bool">Bool</a></pre><button onclick="cp('from telethon.tl.functions.account import UpdatePasswordSettingsRequest');">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>password</b></td><td style="text-align:center"><a href="../../types/input_check_password_srp.html">InputCheckPasswordSRP</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></td></tr></table><h1>Known RPC errors</h1><p>This request can cause 4 known errors:</p><table><tr><td><code>EmailUnconfirmedError</code></td><td>Email unconfirmed, the length of the code must be {code_length}.</td></tr><tr><td><code>NewSaltInvalidError</code></td><td>The new salt is invalid.</td></tr><tr><td><code>NewSettingsInvalidError</code></td><td>The new settings are invalid.</td></tr><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><p>Please refer to the documentation of <a href="https://docs.telethon.dev/en/stable/modules/client.html#telethon.client.auth.AuthMethods.edit_2fa"><code>client.edit_2fa()</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.account.UpdatePasswordSettingsRequest(
|
||
|
password=types.InputCheckPasswordSRP(
|
||
|
srp_id=-12398745604826,
|
||
|
A=<em>b'arbitrary\x7f data \xfa here'</em>,
|
||
|
M1=<em>b'arbitrary\x7f data \xfa 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)</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>
|