При нажатии на кнопку бот не дает ответ
Бот должен давать ответ при нажатии кнопки. Где ошибка?
import telebot
from telebot import types
bot = telebot.TeleBot ()
@bot.message_handler(commands=['command3'])
def start(message):
markup = types.InlineKeyboardMarkup(row_width=2)
item1 = types.InlineKeyboardButton("1 больше 2", callback_data='option1')
item2 = types.InlineKeyboardButton("2 больше 1", callback_data='option2')
markup.add(item1, item2)
bot.send_message(message.chat.id, "ТЕКСТ", reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def callback(call):
if call.data == "option1":
bot.send_message(call.message.chat.id, "Психотип 1")
elif call.data == "option2":
bot.send_message(call.message.chat.id, "Психотип 2")