register_call_back_query_handler #1798
Unanswered
andreyhakobyan
asked this question in
Q&A
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
can you help? why is the "func" function not called when i click on "NO"?
def func(call: types.CallbackQuery, bot):
bot.answer_callback_query(call.message.chat.id, "Answer is No")
def filt(call):
return call.data == 'no'
bot.register_callback_query_handler(
callback=func,
func=filt,
pass_bot=True
)
def gen_markup():
markup = InlineKeyboardMarkup(row_width=2)
btn_yes = InlineKeyboardButton("Yes", callback_data='yes')
btn_no = InlineKeyboardButton("No", callback_data="no")
markup.add(btn_yes, btn_no)
return markup
def start_executor(message):
bot.send_message(message.chat.id, "Yes/no?", reply_markup=gen_markup())
bot.register_message_handler(start_executor, commands=['start'])
Beta Was this translation helpful? Give feedback.
All reactions