A
A
Artyom Tsymbalyuk2017-06-14 22:21:20
Python
Artyom Tsymbalyuk, 2017-06-14 22:21:20

How to fix webhook error?

Hello.
I am learning to write in Python, I want to write a telegram bot. It's been like 3 hours since you downloaded Python ;)

import telebot
import constants

bot = telebot.TeleBot(constants.token)

@bot.message_handler(content_types=['commands'])
def handle_command(message):
    print("Пришла команда")

bot.polling(none_stop=True, interval=0)

The bot token is registered in constants.py
, I have this code, but according to the video lesson it works, and every 2 seconds I get this error in the console:
2017-06-15 00:19:18,623 (__init__.py:272 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 409 Conflict. Response body:
[b'{"ok":false,"error_code":409,"description":"Conflict: terminated by other long poll or webhook"}']"
Please help
6a260e33750d4150a30eb59a8a6c049f.png

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