Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
593 B
3
Indexable
Never
import socks
from telethon import TelegramClient

api_id = 12345
api_hash = 'your_api_hash'
proxy = {
    'host': 'ip',
    'port': 1080,
    'username': 'username',
    'password': 'password',
}

client = TelegramClient(None, api_id, api_hash,  # Session path removed
                        proxy=(socks.SOCKS5, proxy['host'], proxy['port'],
                               username=proxy['username'],
                               password=proxy['password']),
                        system_version="4.16.30-vxCUSTOM",
                        device_model="Linux 5.15.0")
Leave a Comment