mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-06-02 12:43:05 +03:00
Allow overriding phone on .sign_in (fix #278)
This commit is contained in:
parent
1d159908c7
commit
1d250a5441
|
@ -148,9 +148,12 @@ class TelegramClient(TelegramBareClient):
|
||||||
if phone and not code:
|
if phone and not code:
|
||||||
return self.send_code_request(phone)
|
return self.send_code_request(phone)
|
||||||
elif code:
|
elif code:
|
||||||
if self._phone is None:
|
if not self._phone:
|
||||||
|
self._phone = phone
|
||||||
|
if not self._phone:
|
||||||
raise ValueError(
|
raise ValueError(
|
||||||
'Please make sure to call send_code_request first.')
|
'Please make sure to call send_code_request first.'
|
||||||
|
)
|
||||||
|
|
||||||
try:
|
try:
|
||||||
if isinstance(code, int):
|
if isinstance(code, int):
|
||||||
|
|
Loading…
Reference in New Issue
Block a user