G
G
gogo242020-08-25 17:57:23
Bots
gogo24, 2020-08-25 17:57:23

Why does Telegram Bot on Heroku throw an error 'TeleBot' object has no attribute 'message_handler'?

I launch the bot for the first time (a passing person who does this for the first and last time to please friends, I don’t pretend to anything) it crashes on heroku, although through paycharm it calmly executes all commands

here is the beginning of the code

import telebot

bot = telebot.TeleBot('цифры токена')


@bot.message_handler(comands=["start"])
def start_message(message):
    bot.send_voice(message.chat.id, 'AwACAgQAAxkBAAIBJl9BRka-FxE7B6fgRW1MgcesGCuFAAKkGgACxmsIUlA6N-NeyjRnGwQ


error(s)

2020-08-25T14:33:46.467423+00:00 app[worker.1]: Traceback (most recent call last):
2020-08-25T14:33:46.467438+00:00 app[worker.1]: File "my1.py", line 6, in
2020-08-25T14:33:46.467607+00:00 app[worker.1]: @bot.message_handler(commands=['start'] )
2020-08-25T14:33:46.467625+00:00 app[worker.1]: AttributeError: 'TeleBot' object has no attribute 'message_handler'

how to fix?
these methods have already been tried:

pip3 uninstall telebot
pip3 uninstall PyTelegramBotAPI
pip3 install PyTelegramBotAPI
restarting the

telebot computer in pip list is not present, there is only pytelegrambotapi

Maybe it was necessary, in addition to the manipulations described above, to do some other actions that are not obvious to me (since I am a left-handed person in this matter)?

Answer the question

In order to leave comments, you need to log in

1 answer(s)
B
Baselitico, 2021-01-12
@Baselitico

You need to install pyTelegramBotAPI version 3.6.6. Then it will work.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question