Answer the question
In order to leave comments, you need to log in
Why does a 404 error occur when running a bot on putelegrambotapi?
Hello.
Wrote the most elementary code for the Telegram bot pythontelegrambotapi.
import telebot
TOKEN = '<1275117751:AAFYJ4w3G6rjVZy27JxKCmxkev-ft5LpZVg>'
bot = telebot.TeleBot(TOKEN)
@bot.message_handler(content_types=['text'])
def f1(messages):
bot.send_message(message.chat.id, message.text)
bot.polling(none_stop=1)
2020-05-04 18:01:04,601 (__init__.py:443 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 404 Not Found. Response body:
[b'{"ok":false,"error_code":404,"description":"Not Found"}']"
Answer the question
In order to leave comments, you need to log in
1) Remove the angle brackets from the token - "<" and ">"
2) In the "def f1(messages):" line, replace messages with message
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question