@dp.message_handler(content_types=types.ContentTypes.PHOTO,state=CREATEPOSTFSM.Photo_state)
async def process_photos_step(message: Message, state: FSMContext):
photos: List[types.PhotoSize] = message.photo
await state.update_data(photos=photos)
data = await state.get_data()
photos = data.get('photos')
caption = data.get('Info_state')
media_group = [InputMediaPhoto(photo.file_id) for photo in photos]
await message.answer(f'Название продукта: {data.get("Name_state")}')
await message.answer('Вот как будет выглядеть ваш пост:')
await bot.send_media_group(chat_id=message.chat.id, media=media_group)
await state.finish()
Hey guys. I got problem in my project. I have an FSM that gets the title, product information and product photo. After receiving the photo, the same photo is displayed several times.
here I have a link to the media handler, but I'm having a hard time applying it https://github.com/WhiteMemory99/aiogram_album_handler/blob/master/example/album.py