Please help me figure it out: I get an inline message, in response I call.data.isdigit inline button again, this handler works (lambda: true) and the message with callback_data='Y' goes to the first IF call.data.isdigit , but should be in elif call.data == 'Y'
text=str(parse.get_champ(call.data)[0])) IndexError: string index out of range @bot.callback_query_handler(func = lambda call: True) def inline_handler(call): if call.message: if call.data.isdigit(): #Если числовой ID bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text=str(parse.get_champ(call.data)[0])) for i in parse.get_result(call.data): keyboard = types.InlineKeyboardMarkup() item = types.InlineKeyboardButton(text='Подписаться', callback_data='Y') keyboard.add(item) bot.send_message(call.message.chat.id, text = str(i), reply_markup=keyboard) elif call.data == 'Y': # Если Y print('тут')