Кнопка InlineKeyboardButton срабатывает только 1 раз
Во время теста бота нажимаю "Физика" получаю второе меню с маршрутами и т.д., но если ещё раз хочу выбрать "Физика" выдаёт ошибку
2020-10-01 23:20:16,677 (init.py:455 MainThread) ERROR - TeleBot: "A request to the Telegram API was unsuccessful. The server returned HTTP 400 Bad Request. Response body: [b'{"ok":false,"error_code":400,"description":"Bad Request: message text is empty"}']"
@bot.message_handler(commands=['start'])
def start(message):
btn6 = types.InlineKeyboardButton('Физика', callback_data='men_ph')
markup = types.InlineKeyboardMarkup(row_width=1)
markup.add(btn6)
send_mess = f'hi {message.from_user.first_name} {message.from_user.last_name}'
bot.send_message(message.chat.id, send_mess, reply_markup=markup)
@bot.callback_query_handler(func=lambda call: True)
def ans(call):
if call.data == 'men_ph':
ph_button1 = types.InlineKeyboardButton('Маршруты', callback_data='ph_rote')
ph_button2 = types.InlineKeyboardButton('Лабы', callback_data='ph_labs')
markup = types.InlineKeyboardMarkup(row_width=2)
markup.add(ph_button1, ph_button2)
bot.send_message(call.message.chat.id, phys.read(), parse_mode="HTML", reply_markup=markup)