Answer the question
In order to leave comments, you need to log in
How to display aiogram notification?
Hai, I want to display a sneaky notification when the button is clicked:
Code:
@dp.callback_query_handler(lambda call: True)
async def callback_inline(call):
await call.answer()
id_user = call.from_user.id
if 'pchanel_' in call.data:
await call.answer('test', show_alert=False)
print('test')
Answer the question
In order to leave comments, you need to log in
Handler doesn’t work for you, you
should use lambda differently
, for example, you have a button:
btn = InlineKeyboardButton(text="Яблоко", callback_data='button228')
@dp.callback_query_handler(lambda c: c.data == 'button228')
async def apple_test(call: CallbackQuery):
await call.answer(text='Яблоко взято')
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question