RecoverPasswordRequest
Only users can use this method. See code examples.
---functions--- auth.recoverPassword#37096c70 flags:# code:string new_settings:flags.0?account.PasswordInputSettings = auth.Authorization
Returns
| auth.Authorization |
This type can be an instance of either:
| Authorization | AuthorizationSignUpRequired |
Parameters
| code | string | |
| new_settings | account.PasswordInputSettings | This argument defaults to None and can be omitted. |
Known RPC errors
This request can cause 2 known errors:
CodeEmptyError | The provided code is empty. |
NewSettingsInvalidError | The new settings are invalid. |
You can import these from telethon.errors.
Example
from telethon.sync import TelegramClient
from telethon import functions, types
with TelegramClient(name, api_id, api_hash) as client:
result = client(functions.auth.RecoverPasswordRequest(
code='some string here',
new_settings=types.account.PasswordInputSettings(
new_algo=types.PasswordKdfAlgoUnknown(),
new_password_hash=b'arbitrary\x7f data \xfa here',
hint='some string here',
email='some string here',
new_secure_settings=types.SecureSecretSettings(
secure_algo=types.SecurePasswordKdfAlgoUnknown(),
secure_secret=b'arbitrary\x7f data \xfa here',
secure_secret_id=-12398745604826
)
)
))
print(result.stringify())