Answer the question
In order to leave comments, you need to log in
Why is the telegram bot not connecting to the bot api?
Here is the test application code:
import telebot
from telebot import apihelper
import config
bot = telebot.TeleBot(config.token, threaded=False)
ip = '147.135.210.114' # https://free-proxy-list.net/anonymous-proxy.html
port = '54566'
apihelper.proxy = {
'http', 'socks5://login:[email protected]{}:{}'.format(ip, port),
'https', 'socks5://login:[email protected]{}:{}'.format(ip, port)
}
bot.send_message(config.chat_id, '123')
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(10061, 'Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение', None, 10061, None))
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