R
R
Ruslan Amerkhanov2018-04-28 12:50:13
Telegram
Ruslan Amerkhanov, 2018-04-28 12:50:13

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')

And here is the compiler's response:
raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionRefusedError(10061, 'Подключение не установлено, т.к. конечный компьютер отверг запрос на подключение', None, 10061, None))

Please tell me how to fix this.

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question