M
M
Max2019-05-20 18:11:57
Python
Max, 2019-05-20 18:11:57

Python telebot error, what to do?

Hello everyone, I ran into such a problem, Telebot just stopped working.
Even such a bot does not launch:

import telebot

bot = telebot.TeleBot('*****56474:*********WYdV_7VqtYx_MXW7cp3_c')

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

@bot.message_handler(commands=['help'])
def start_message(message):
    bot.send_message(message.chat.id, 'Привет, ты нажал HELP')


bot.polling()

Here's what it says:
Traceback (most recent call last):
File "C:/Users/Administrator/AppData/Local/Programs/Python/Python37-32/qqqq.py", line 5, in
@bot.message_handler(commands= ['start'])
AttributeError: 'TeleBot' object has no attribute 'message_handler'
And on another laptop:
Traceback (most recent call last):
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\ pydev\pydevd.py", line 1741, in
main()
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\pydevd.py", line 1574, in main
setup = process_command_line(sys .argv)
File "C:\Program Files\JetBrains\PyCharm Community Edition 2019.1.1\helpers\pydev\_pydevd_bundle\pydevd_command_line_handling.py", line 136, in process_command_line
setup['file'] = argv[i]
IndexError: list index out of range
I've only been writing bots for a month, I wrote on telepot, everything was fine, I decided to try again on telebot and there is such a problem.
How to solve it?
And I also wanted to ask where you can get good material on bots in TG, preferably on telebot / pot

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Awone, 2019-05-21
@Awone

https://groosha.gitbook.io/telegram-bot-lessons/
Good stuff

R
R27111337, 2019-11-30
@R27111337

Open ...\Python3x\Lib\site-packages\pyTelegramBotAPI-3.6.6-py3.8.egg\telebot\apihelper.py, find line 49 and comment it out. It may not be correct, but it works5de1c0842b87f085756134.jpeg

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question