UpdatePasswordSettingsRequest

Only users can use this request. See code examples.

---functions---
account.updatePasswordSettings#a59b102f password:InputCheckPasswordSRP new_settings:account.PasswordInputSettings = Bool

Returns

Bool

This type has no instances available.

Parameters

passwordInputCheckPasswordSRP
new_settingsaccount.PasswordInputSettings

Known RPC errors

This request can cause 4 known errors:

EmailUnconfirmedErrorEmail unconfirmed, the length of the code must be {code_length}.
NewSaltInvalidErrorThe new salt is invalid.
NewSettingsInvalidErrorThe new settings are invalid.
PasswordHashInvalidErrorThe password (and thus its hash value) you entered is invalid.

You can import these from telethon.errors.

Example

Please refer to the documentation of client.edit_2fa() to learn about the parameters and see several code examples on how to use it.

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.

from telethon.sync import TelegramClient
from telethon import functions, types

with TelegramClient(name, api_id, api_hash) as client:
    result = client(functions.account.UpdatePasswordSettingsRequest(
        password=types.InputCheckPasswordSRP(
            srp_id=-12398745604826,
            A=b'arbitrary\x7f data \xfa here',
            M1=b'arbitrary\x7f data \xfa 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)