T
T
tixonochek2021-02-21 02:15:16
Python
tixonochek, 2021-02-21 02:15:16

Telebot - Why is there an error?

See I have the code:

import telebot

bot = telebot.TeleBot('токен')

@bot.message_handler(commands=['start'])
def start_message(message):
    bot.send_message(message.chat.id, 'Привет, ты написал мне /start')

bot.polling()


And the packages are installed:
- telebot
- pytelegrambotapi

But still nothing comes out. Everywhere on the Internet they write you need to install new versions - but still the result is an error! And I don’t understand why .. Also, people write what works in PyCharm, but not outside of it - but I have not tried and do not use PyCharm, so this method does not suit me.

(Well, I'm a fool, I forgot to write the error itself first, here it is: The 'Telebot' object does not have the 'message_handler' attribute!)

I beg you, help!!!

Answer the question

In order to leave comments, you need to log in

2 answer(s)
I
Ivan Yakushenko, 2021-02-21
@kshnkvn

Well, why did you install 2 different libraries that conflict with each other?
Something that doesn't look like :

And my boots are cool, even very. So don't tell me I can't make bots. I know the basics very well, and not only ..

Maybe a little book to learn the basics? Well, or at least the documentation / guides for the library that you are going to use?

M
Mikhail Krostelev, 2021-02-21
@twistfire92

Delete the telebot library.
How to do this is googled on easy.
Read books on Python development.
The problem is not knowing the basics.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question