mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-09 05:19:41 +00:00
Phone number shouldn't actually start with '+'
This commit is contained in:
@@ -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
|
||||||
|
Reference in New Issue
Block a user