R
R
Roma Kotolup2021-03-26 20:00:39
Python
Roma Kotolup, 2021-03-26 20:00:39

Why doesn't the python pyTelegramBotAPI bot work?

Why doesn't the python pyTelegramBotAPI bot work?
the code:

the code
import telebot
bot = telebot.TeleBot("TOKEN")
@bot.message_handler(commands=['start'])
def send_welcome(message):
        bot.reply_to(message, "Howdy, how are you doing?")
bot.polling()

does not work:
error
Traceback (most recent call last):
File "C:\Users\Oksana\Desktop\red.py", line 9, in
@bot.message_handler(commands=['start'])
AttributeError: 'TeleBot' object has no attribute 'message_handler'

How to fix it?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
B
bbkmzzzz, 2021-03-26
@roma2

tyk
tyk

S
Sergey Karbivnichy, 2021-03-26
@hottabxp

Most likely the telebot library is installed.
So:

pip uninstall telebot
pip install pytelegrambotapi

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question