Home python Error Telegram bot

Error Telegram bot

Author

Date

Category

Error –

@ bot.message_handler (content_types = ['text'])
ATTRIBUTEERROR: 'TELEBOT' OBJECT HAS NO Attribute 'Message_Handler'

How to eliminate the error?
With Telebot and Pytelegrambotapi libraries have already been played (did not help)

code

import telbot
Import Config
BOT = TELEBOT.TELEBOT (config.Token)
@ Bot.Message_Handler (Content_Types = ['Text'])
Def Lalal (Message):
  Bot.Send_Message (Message.Chat.ID, Message.Text)
Bot.Polling (None_Stop = True)

Answer 1

It was necessary to go to Pycharm (I used Pycharm) and there to go to Preferences (on the Mac) -Projects- & gt; Python Interpreter (and check if all the necessary libraries are there). Add, if not Telebot and pytelegrambotapi
. Also that would resolve the issue with Webhoo. It was possible in the penultimate line of code to add bott.remove_webhook ()

Programmers, Start Your Engines!

Why spend time searching for the correct question and then entering your answer when you can find it in a second? That's what CompuTicket is all about! Here you'll find thousands of questions and answers from hundreds of computer languages.

Recent questions