D
D
Danil Neskazhu2020-08-02 14:36:04
Python
Danil Neskazhu, 2020-08-02 14:36:04

Is multilevel inline menu of TG bot on aiogram possible?

I want to make a multi-level inline menu on aiogram.
But I ran into a problem that when I set callback_query_handler and make the bot's response to callback_data. using answer_callback_query, I can't attach the following inline keyboard to this answer by assigning it to reply_markup . The terminal writes that there is no reply_markup keyword in this callback_query_handler method.

How can I hook a keyboard to this method? Or is there an analogue in this handler that can pick it up?

@dp.callback_query_handler(func=lambda c: c.data and c.data.startswith('result'))
async def process_callback_kb1btn1(call: types.CallbackQuery):
    user = user_data[call.id]
    game_list = user.result
    code = call.data[-1]
    int(code)
    await bot.answer_callback_query(call.id, text= f"[.]({game_list[code]['img']}) {game_list[code]['names']} .\
        \n Цена ≈ {game_list[code]['price']} руб/{game_list[code]['text_price']} USD",\
        reply_markup= keyboards.start_menu #терминал говорит, что reply_markup не присутствует в данном методе )

Answer the question

In order to leave comments, you need to log in

1 answer(s)
S
soremix, 2020-08-02
@dannight0151

That's right, did you even look at the answercallbackquery documentation ?
This is a pop-up notification, how to connect buttons to it
https://core.telegram.org/bots/api#answercallbackquery

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question