[Python] I can't upload an image via InputStoryContentPhoto to aiogram3

Discussão em 'Python' iniciado por Stack, Setembro 3, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to write a bot on aiogram3 that will create stories in telegram via business mode

    photo = FSInputFile("./a.jpg", filename="a.jpg")
    content = InputStoryContentPhoto(photo=f"attach://a.jpg")
    await callback.bot.post_story(
    business_connection_id=user["business_connection_id"],
    content=content,
    active_period=86400,
    post_to_chat_page=True
    )


    result:


    TelegramBadRequest: Telegram server says - Bad Request: story photo must be uploaded as a file
    ​

    the photo I'm trying to upload has a resolution of 1080x1920 as required in the docs.

    I also tried passing the FSInputFile directly to InputStoryContentPhoto.

    Continue reading...

Compartilhe esta Página