cuprumvsargetium
@cuprumvsargetium
228

Почему не конектится?

1) 2020-01-13 18:37:27,482 (util.py:65 PollingThread) ERROR - TeleBot: "ConnectionError occurred, args=(ProtocolError('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer')),)
2)ConnectionResetError: [Errno 104] Connection reset by peer
3)urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
4)requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
5)ConnectionResetError: [Errno 104] Connection reset by peer
6)urllib3.exceptions.ProtocolError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))
7)raise ConnectionError(err, request=request)
requests.exceptions.ConnectionError: ('Connection aborted.', ConnectionResetError(104, 'Connection reset by peer'))

Везде Traceback (most recent call last):

import telebot

bot = telebot.TeleBot('943283066:AAFrPJdFUPfkZNCcM5CnJ4enGhcwd1DcCLM')

@bot.message_handler(commands=['start'])

def start_message(message):
    bot.send_message(message.chat.id, 'Привет, ты написал мне /start')

bot.polling()
  • Вопрос задан
  • 3120 просмотров
Решения вопроса 1
@kiriharu
Python backend, Linux enjoyer
Скорее всего, не хватает проксей, скажите спасибо РКН за это. Пропишите прокси (например socks5) вот так:

from telebot import apihelper
apihelper.proxy = {'https': 'socks5://telegram.vpn.net:55555'}
# {'https': 'socks5://айпи или домен:порт сервера'}
# если используется вход через пару логин:пароль
# {'https': 'socks5://логин:пароль@айпи или домен:порт сервера'}
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы