darkerpeople, proxy (`tuple` | `list` | `dict`, optional): An iterable consisting of the proxy info. If `connection` is one of `MTProxy`, then it should contain MTProxy credentials: ``('hostname', port, 'secret')``. Otherwise, it's meant to store function parameters for PySocks, like ``(type, 'hostname', port)``. See https://github.com/Anorov/PySocks#usage-1 for more.
from telethon.sync import TelegramClient from telethon import connection # ****** proxy = ('proxy_address', 1080) # ******: IP и порт proxy_type = connection.ConnectionTcpMTProxy # Для MTProxy, для SOCKS5 нужен другой тип # Ваши данные для подключения api_id = 'YOUR_API_ID' api_hash = 'YOUR_API_HASH' phone_number = 'YOUR_PHONE_NUMBER' client = TelegramClient('session_name', API_HASH, API_ID, connection=proxy_type, proxy=proxy) client.start(phone_number) print("САСАТЬ!") Code from telethon.sync import TelegramClient from telethon import connection # ****** proxy = ('proxy_address', 1080) # ******: IP и порт proxy_type = connection.ConnectionTcpMTProxy # Для MTProxy, для SOCKS5 нужен другой тип # Ваши данные для подключения api_id = 'YOUR_API_ID' api_hash = 'YOUR_API_HASH' phone_number = 'YOUR_PHONE_NUMBER' client = TelegramClient('session_name', API_HASH, API_ID, connection=proxy_type, proxy=proxy) client.start(phone_number) print("САСАТЬ!")