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)[source]

Bases: telegram.InputMedia

Represents a live photo to be sent.

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[source]

'live_photo'.

Type:

str

media[source]

Video of the live photo to send.

Type:

str | telegram.InputFile

photo[source]

The static photo to send.

Type:

str | telegram.InputFile

caption[source]

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

Type:

str

parse_mode[source]

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

Type:

str

caption_entities[source]

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[source]

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

Type:

bool

has_spoiler[source]

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

Type:

bool