mirror of
https://github.com/LonamiWebs/Telethon.git
synced 2025-08-08 21:10:29 +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):
|
||||
"""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
|
||||
|
Reference in New Issue
Block a user