account.updatePasswordSettings
Set a new 2FA password
func (c *Client) AccountUpdatePasswordSettings(ctx context.Context, request *AccountUpdatePasswordSettingsRequest) (bool, error)
Calling this method
client.Run(ctx, func(ctx context.Context) error {
api := client.API()
res, err := api.AccountUpdatePasswordSettings(ctx, &tg.AccountUpdatePasswordSettingsRequest{
// see Parameters
})
if err != nil {
return err
}
_ = res // bool
return nil
})
Parameters
| Name | Type | Required | Description |
|---|---|---|---|
Password | InputCheckPasswordSRPClass | yes | The old password (see SRP) |
NewSettings | AccountPasswordInputSettings | yes | The new password (see SRP) |
Returns
bool
Possible errors
| Code | Type | Description |
|---|---|---|
| 400 | EMAIL_INVALID | The specified email is invalid. |
| 400 | EMAIL_UNCONFIRMED | Email unconfirmed. |
| 400 | NEW_SALT_INVALID | The new salt is invalid. |
| 400 | NEW_SETTINGS_EMPTY | No password is set on the current account, and no new password was specified in new_settings. |
| 400 | NEW_SETTINGS_INVALID | The new password settings are invalid. |
| 400 | PASSWORD_HASH_INVALID | The provided password hash is invalid. |
| 400 | SRP_ID_INVALID | Invalid SRP ID provided. |
| 400 | SRP_PASSWORD_CHANGED | Password has changed. |
References
- Official documentation
- Generated Go reference
- TL definition:
account.updatePasswordSettings#a59b102f