Не могу поменять фото в сообщение aiogram
нужна помощь, нужно заменить отправленное фото с inline кнопками, на другие, чтобы получилось что-то вроде листания фото в одном сообщение.. подскажите пожалуйста как реализовать?
await bot.send_message(message.chat.id, f"первый текст", reply_markup=keyboard.hairorbrow, parse_mode='Markdown')
@dp.callback_query_handler(text_contains='hair')
async def hair(call: types.CallbackQuery):
await bot.edit_message_text(chat_id=call.message.chat.id, message_id=call.message.message_id, text = "второй текст", parse_mode='Markdown')
with open('hair-1.jpg', 'rb') as photo:
await bot.send_photo(chat_id=call.message.chat.id, photo=photo, reply_markup=keyboard.hairmenu)
@dp.callback_query_handler(text_contains='nexthair')
async def nexthair(call: types.CallbackQuery):
with open('hair-2.jpg', 'rb') as file:
photo = types.InputMediaPhoto(file)
await bot.edit_message_media(chat_id=call.message.chat.id, message_id=call.message.message_id, media=photo)
aiogram.utils.exceptions.BadRequest: There is no text in the message to edit