Answer the question
In order to leave comments, you need to log in
How to pass a parameter to message_handler?
There is a hanbler:
@dp.callback_query_handler(text="query")
async def query_file(call: types.CallbackQuery):
await call.answer(text=a, show_alert=True)
inline_btn_1 = InlineKeyboardButton(' Уведомить', callback_data='query')
inline_kb1 = InlineKeyboardMarkup().add(inline_btn_1)
a = 36
bot.send_message(msg.from_user.id, f"К сожалению {a} не найдено.\nНажмите на кнопку, чтобы получить уведомление ", reply_markup=inline_kb1)
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question