mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-24 08:14:14 +03:00
Phone number shouldn't actually start with '+'
This commit is contained in:
parent
9ae4f7f641
commit
b8d7b1c8af
|
@ -282,8 +282,12 @@ class TelegramClient(TelegramBareClient):
|
|||
|
||||
def send_code_request(self, phone):
|
||||
"""Sends a code request to the specified phone number"""
|
||||
result = self(
|
||||
SendCodeRequest(phone, self.api_id, self.api_hash))
|
||||
if isinstance(phone, int):
|
||||
phone = str(phone)
|
||||
elif phone.startswith('+'):
|
||||
phone = phone.strip('+')
|
||||
|
||||
result = self(SendCodeRequest(phone, self.api_id, self.api_hash))
|
||||
self._phone = phone
|
||||
self._phone_code_hash = result.phone_code_hash
|
||||
return result
|
||||
|
|
Loading…
Reference in New Issue
Block a user