mirror of
https://github.com/danog/MadelineProtoDocs.git
synced 2024-11-26 12:25:08 +01:00
943 B
943 B
title | description | redirect_from | grand_parent | parent |
---|---|---|---|---|
update2fa | Update 2FA password | /update_2fa.html | Telegram RPC API | Methods |
Method: update2fa
The params array can contain password (current password), new_password, email (optional) and hint params.
Parameters:
Name | Type |
---|---|
params | An array of parameters |
Return type: Bool
Example (now fully async!):
try {
$MadelineProto->update2fa(['password' => 'current password', 'new_password' => 'New password', 'email' => 'daniil@daniil.it', 'hint' => 'ponies']);
} catch (RPCErrorException $e) {
if (strpos($e->rpc, 'EMAIL_UNCONFIRMED_') !== false) {
$Bool = $MadelineProto->account->confirmPasswordEmail(['code' => $MadelineProto->readline('Enter your email code: ')]);
} else {
throw $e;
}
}