mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-01-24 16:24:15 +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):
|
def send_code_request(self, phone):
|
||||||
"""Sends a code request to the specified phone number"""
|
"""Sends a code request to the specified phone number"""
|
||||||
result = self(
|
if isinstance(phone, int):
|
||||||
SendCodeRequest(phone, self.api_id, self.api_hash))
|
phone = str(phone)
|
||||||
|
elif phone.startswith('+'):
|
||||||
|
phone = phone.strip('+')
|
||||||
|
|
||||||
|
result = self(SendCodeRequest(phone, self.api_id, self.api_hash))
|
||||||
self._phone = phone
|
self._phone = phone
|
||||||
self._phone_code_hash = result.phone_code_hash
|
self._phone_code_hash = result.phone_code_hash
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in New Issue
Block a user