G
G
galtim112020-05-09 18:40:19
Python
galtim11, 2020-05-09 18:40:19

I don't understand why doesn't the bot not work?

Here is the code:

import telebot
import parser

TOKEN = '1190811079:AAEui3GQq1yJOk8pivrcjA8cVMIFBi1lI0A'
bot = telebot.TeleBot(TOKEN)

@bot.message_handler(commands=['start', 'go'])
def start_handler(message):
    bot.send_message(message.chat.id, 'Привет, когда я вырасту, я буду парсить заголовки с Хабра')
bot.polling()

Here is the error:
2020-05-09 18:36:30,423 (util.py:65 PollingThread) ERROR - TeleBot: "SSLError occurred, args=(MaxRetryError("HTTPSConnectionPool(host='api.telegram.org', port=443): Max retries exceeded with url: /bot1190811079:AAEui3GQq1yJOk8pivrcjA8cVMIFBi1lI0A/getUpdates?offset=1&timeout=20 (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: self signed certificate (_ssl.c:1056)')))"),)

tell me what to fix plz

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
Alexander Ivanov, 2020-05-12
@aschurf

For local testing, use a proxy or Windscribe. And never post the token, you will be left without a bot :)

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question