mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-06 05:00:23 +03:00
more things
This commit is contained in:
parent
03b237ec14
commit
f70d03fdba
|
@ -2471,12 +2471,13 @@ class TelegramClient(TelegramBareClient):
|
||||||
'Make sure you have encountered this peer before.'.format(peer)
|
'Make sure you have encountered this peer before.'.format(peer)
|
||||||
)
|
)
|
||||||
|
|
||||||
def edit_2fa(self, current_password=None, new_password=None, hint='', email=None):
|
def edit_2fa(self, current_password=None, new_password=None, hint='',
|
||||||
|
email=None):
|
||||||
"""
|
"""
|
||||||
Changes the 2FA settings of the logged in user, according to the
|
Changes the 2FA settings of the logged in user, according to the
|
||||||
passed parameters. Take note of the parameter explanations.
|
passed parameters. Take note of the parameter explanations.
|
||||||
|
|
||||||
This method has no effect if both current and new password are omitted.
|
Has no effect if both current and new password are omitted.
|
||||||
|
|
||||||
current_password (:obj:`str`, optional):
|
current_password (:obj:`str`, optional):
|
||||||
The current password, to authorize changing to ``new_password``.
|
The current password, to authorize changing to ``new_password``.
|
||||||
|
@ -2485,8 +2486,9 @@ class TelegramClient(TelegramBareClient):
|
||||||
Passing this by itself will remove 2FA (if correct).
|
Passing this by itself will remove 2FA (if correct).
|
||||||
|
|
||||||
new_password (:obj:`str`, optional):
|
new_password (:obj:`str`, optional):
|
||||||
The password to set as 2FA. If 2FA was already enabled, ``current_password``
|
The password to set as 2FA.
|
||||||
**must** be set. Leaving this blank or ``None`` will remove the password.
|
If 2FA was already enabled, ``current_password`` **must** be set.
|
||||||
|
Leaving this blank or ``None`` will remove the password.
|
||||||
|
|
||||||
hint (:obj:`str`, optional):
|
hint (:obj:`str`, optional):
|
||||||
Hint to be displayed by Telegram when it asks for 2FA.
|
Hint to be displayed by Telegram when it asks for 2FA.
|
||||||
|
@ -2494,15 +2496,12 @@ class TelegramClient(TelegramBareClient):
|
||||||
Has no effect if ``new_password`` is not set.
|
Has no effect if ``new_password`` is not set.
|
||||||
|
|
||||||
email (:obj:`str`, optional):
|
email (:obj:`str`, optional):
|
||||||
Recovery and verification email.
|
Recovery and verification email. Raises ``EmailUnconfirmedError``
|
||||||
Raises ``EmailUnconfirmedError`` if value differs from current one
|
if value differs from current one, and has no effect if
|
||||||
Has no effect if ``new_password`` is not set.
|
``new_password`` is not set.
|
||||||
|
|
||||||
Returns:
|
Returns:
|
||||||
``True`` if successful, ``False`` otherwise.
|
``True`` if successful, ``False`` otherwise.
|
||||||
|
|
||||||
Raises:
|
|
||||||
:obj:`PasswordEmptyError` if
|
|
||||||
"""
|
"""
|
||||||
if new_password is None and current_password is None:
|
if new_password is None and current_password is None:
|
||||||
return False
|
return False
|
||||||
|
|
Loading…
Reference in New Issue
Block a user