url = 'https://api.telegram.org/auth.signIn'
data = {
'phone_number': phone_number,
'phone_code': phone_code
}
r = requests.post(url, data=data)
#получаешь сессию
async def main():
client = TelegramClient('session', api_id, api_hash)
assert await client.connect()
if not client.is_user_authorized():
await client.send_code_request(phone_number)
me = await client.sign_in(phone_number, input('Enter code: '))
#Затем заходишь по ней
async def main():
client = TelegramClient('session', api_id, api_hash)
await client.start()