G
G
galtim112020-05-09 19:43:52
Python
galtim11, 2020-05-09 19:43:52

Problem with polling in python bot?

the code:

import telebot
import time

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

@bot.message_handler(commands=['start', 'help'])
def send_welcome(message):
  bot.reply_to(message, "Howdy, how are you doing?")
@bot.message_handler(func=lambda m: True)
def echo_all(message):
  bot.reply_to(message, message.text)

bot.polling()

the bot starts and works only if there is no line bot.polling()
further gives an 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)')))"),)

what to do with polling?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
I
Ivan Yakushenko, 2020-05-09
@galtim11

Because Roskomnadzor blocks access to Telegram. Use a proxy, as indicated here , or use a VPS on which Telegram is not blocked.

G
galtim11, 2020-05-09
@galtim11

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(SSLError("bad handshake: Error([(\'SSL routines\', \'tls_process_server_certificate\', \'certificate verify failed\')],)",),))',),)
Traceback (most recent call last):

same error

B
BasiC2k, 2020-05-10
@BasiC2k

Would you hide the token...

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question