from telethon import TelegramClient
import socks
import json
import asyncio
proxy = {
'proxy_type': socks.HTTP,
'addr': 'addr',
'port': port,
'username': 'username',
'password': 'password'
}
with open('file.json', 'r') as file:
client_data = json.load(file)
channel = 'https://t.me/channel'
async def main():
# на этом конец
async with TelegramClient(client_data['session_file'],
api_id=client_data['app_id'],
api_hash=client_data['app_hash'],
app_version=client_data['app_version'],
device_model=client_data['device'],
system_version=client_data['sdk'],
proxy=proxy) as client:
me = await client.get_me()
print(me.stringify())
asyncio.run(main())