I`m trying to make a simple telegram bot, but I have a problem. I've installed all necessary modules using bash , but I got AttributeError: 'TeleBot' object has no attribute 'message_handler' and if I use sys.modules() while running main file - there is no pytelegrambotapi module. How can I fix it?
from flask import Flask, request
import telebot
token = '1061.........FRozpkKCROV2Cs'
bot = telebot.TeleBot(token)
app = Flask(__name__)
@app.route('/', methods=["POST"])
def webhook():
bot.process_new_updates([telebot.types.Update.de_json(request.stream.read().decode("utf-8"))])
return "!", 200
@bot.message_handler(commands=['start'])
def command(message):
bot.send_message(message.chat.id, 'Hi, ' + message.chat.first_name + '!')