该机器人具有“订购用具”功能。有一个 MediaGroupBuilder 显示消息和照片,是否可以以某种方式向该消息添加内联键盘?(现在的输出如图所示)(我在文档中没有找到它,我用谷歌搜索了它,但没有看到任何东西)
@router.callback_query(lambda query: query.data == "start_attribute_order")
async def start_attribute_order(query : types.CallbackQuery, state: FSMContext):
album_builder = MediaGroupBuilder(
caption="Доступная атрибутика"
)
photos = [
"https://img-lcwaikiki.mncdn.com/mnresize/1024/-/pim/productimages/20221/5422056/l_20221-s20637z8-csw_a2.jpg",
"https://legionmurmansk.ru/images/thumbnails/1143/1000/detailed/2/%D0%A7%D0%B5%D1%80%D0%BD%D0%B0%D1%8F_%D1%84%D1%83%D1%82%D0%B1%D0%BE%D0%BB%D0%BA%D0%B0.jpg",
"https://files.giftsoffer.ru/reviewer/tb/99/5190.60_15.jpg"
]
for photo in photos:
album_builder.add_photo(media=photo)
kb = [
[types.InlineKeyboardButton(text="Кепка", callback_data="Кепка"),],
[types.InlineKeyboardButton(text="Футболка черная", callback_data="Футболка черная"),],
[types.InlineKeyboardButton(text="Футболка белая", callback_data="Футболка белая"),],
]
keyboard = types.InlineKeyboardMarkup(inline_keyboard=kb)
await query.message.answer_media_group(media=album_builder.build(), reply_markup=keyboard)
await state.set_state(OrderDialog.order_item)