Answer the question
In order to leave comments, you need to log in
I'm trying to log in to Telegram via telethon, but an error occurs with asynchrony. Helpanyote?
I use the telethon library to interact with the Telegram API. I use the code for authorization with a proxy. But it’s not enough to simply indicate there proxy=()
, so I’m acting with sockets from the PySocks library :
from telethon import TelegramClient
import socks
import socket
socks.set_default_proxy(socks.SOCKS5, addr='адрес', port=1234,
username='логин', password='пароль')
socket.socket = socks.socksocket
phone = '+7..........'
api_id = 1234567
api_hash = 'апи_хэш'
session = phone
client = TelegramClient(session, api_id, api_hash)
client.start()
Traceback (most recent call last):
File "C:\Program Files\Python38\lib\asyncio\base_events.py", line 656, in __del__
File "C:\Program Files\Python38\lib\asyncio\proactor_events.py", line 684, in close
File "C:\Program Files\Python38\lib\asyncio\proactor_events.py", line 752, in _close_self_pipe
AttributeError: 'ProactorEventLoop' object has no attribute '_ssock'
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question