Skip to content
Back to top
View this page

# InputMediaLivePhoto

class telegram.InputMediaLivePhoto(media, photo, caption=None, parse_mode=None, caption_entities=None, show_caption_above_media=None, has_spoiler=None, *, api_kwargs=None)

  Bases: `telegram.InputMedia`

  Represents a live photo to be sent.

  See also

  Working with Files and Media

  Use In

  - `telegram.Bot.edit_message_media()`

  - `telegram.Bot.send_media_group()`

  - `telegram.Bot.send_poll()`

  Available In

  `telegram.InputPollOption.media`

  Added in version 22.8.

  Parameters:

    - media (`str` | file object | `InputFile` | `bytes` | `pathlib.Path` | `Video`) – Video of the live photo to send. Pass a `file_id` to send a file that exists on the Telegram servers (recommended). To upload a file, you can either pass a file object (e.g. `open("filename", "rb")`) or the file contents as bytes. If the bot is running in `local_mode`, passing the path of the file (as string or `pathlib.Path` object) is supported as well. Sending live photos by a URL is currently unsupported. Lastly you can pass an existing `telegram.Video` object to send.

    - photo (`str` | file object | `InputFile` | `bytes` | `pathlib.Path` | `PhotoSize`) – The static photo to send. Pass a `file_id` to send a file that exists on the Telegram servers (recommended). To upload a file, you can either pass a file object (e.g. `open("filename", "rb")`) or the file contents as bytes. If the bot is running in `local_mode`, passing the path of the file (as string or `pathlib.Path` object) is supported as well. Sending live photos by a URL is currently unsupported. Lastly you can pass an existing `telegram.PhotoSize` object to send.

    - caption (`str`, optional) – Caption of the live photo to be sent, 0-`1024` characters after entities parsing.

    - parse_mode (`str`, optional) – Mode for parsing entities. See `telegram.constants.ParseMode` and formatting options for more details.

    - caption_entities (Sequence[`telegram.MessageEntity`], optional) – Sequence of special entities that appear in the caption, which can be specified instead of `parse_mode`.

    - show_caption_above_media (`bool`, optional) – Pass `True`, if the caption must be shown above the message media.

    - has_spoiler (`bool`, optional) – Pass `True`, if the video needs to be covered with a spoiler animation.

  type

    `'live_photo'`.

    Type:

      `str`

  media

    Video of the live photo to send.

    Type:

      `str` | `telegram.InputFile`

  photo

    The static photo to send.

    Type:

      `str` | `telegram.InputFile`

  caption

    Optional. Caption of the live photo to be sent, 0-`1024` characters after entities parsing.

    Type:

      `str`

  parse_mode

    Optional. Mode for parsing entities. See `telegram.constants.ParseMode` and formatting options for more details.

    Type:

      `str`

  caption_entities

    Optional. Tuple of special entities that appear in the caption, which can be specified instead of `parse_mode`.

    Type:

      tuple[`telegram.MessageEntity`]

  show_caption_above_media

    Optional. `True`, if the caption must be shown above the message media.

    Type:

      `bool`

  has_spoiler

    Optional. `True`, if the video is covered with a spoiler animation.

    Type:

      `bool`