@bot.message_handler(commands=['start'])

import telebot
from telebot import TeleBot

bot: TeleBot = telebot.TeleBot('token')


@bot.message_handler(commands=['start'])
def start(message):
    send_mess = f"<b> Кчау, {message.from_user.first_name} {message.from_user.last_name}!</b>"
    bot.send_message(message.chat.id, send_mess, parse_mode='html')


bot.polling(none_stor=True)

Выдает ошибку

Traceback (most recent call last):
  File "C:\Users\user\PycharmProjects\бот\bot.py", line 7, in <module>
    @bot.message_handler(commands=['start'])
AttributeError: 'TeleBot' object has no attribute 'message_handler'

Пробовал переустанавливать библиотеку Telebot с последующей перезагрузкой, не помогло.


Ответы (2 шт):

Автор решения: nomnoms12

Переустановите библиотеку следующим образом:

pip uninstall telebot
pip install -U pytelegrambotapi
→ Ссылка
Автор решения: Max Dublikunt

Скачай репозиторий с гит хаба https://github.com/eternnoir/pyTelegramBotAPI и установи с него эту библиотеку но не забудь удалить её командой pip uninstall telebot

→ Ссылка