W
W
Web__Nikita032019-05-21 18:35:44
Python
Web__Nikita03, 2019-05-21 18:35:44

Why does the bot crash with an error?

I followed this instruction https://qsy.by/telegram-bot-na-python-chast-2-pych... , starting from the line, we will start writing code.
Here is the code

import telebot
from telebot import apihelper
TOKEN = '836764194:AAHd4h                           Kv1HVvIl1g'
apihelper.proxy = {'http':'http://171.255.192.118:8080'}
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(commands=['start'])
def start(message):
    sent = bot.send_message(message.chat.id, 'Как тебя зовут?')

bot.polling()

Here is what is installed
5ce41a1e58ee6087841233.png
Here is the error itself
https://pastebin.com/Abmitumf
Proxy also does not work

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
Danil K., 2019-06-07
@Web__Nikita03

import telebot
from telebot import apihelper

bot = telebot.TeleBot(TOKEN)
apihelper.proxy = {'https': 'socks5h://user:[email protected]:1080'}

<...>

pyTelegramBotAPI
in socks5:// documentation, try socks5 h ://

X
xtell96, 2019-05-21
@xtell96

Perhaps due to the fact that the provider blocked access to the telegram.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question