peyk.platforms.telegram.types.input_media_photo

Classes

InputMediaPhoto(media[, caption, ...])

Represents a photo to be sent.

class peyk.platforms.telegram.types.input_media_photo.InputMediaPhoto(media: object, caption: str | None = None, parse_mode: str | None = None, caption_entities: List[MessageEntity] | None = None, show_caption_above_media: bool | None = None, has_spoiler: bool | None = None)[source]

Bases: object

Represents a photo to be sent.

Variables:
  • type – Type of the media, must be photo

  • media (object) – File to send. Pass a file_id to send a file that exists on the Telegram servers (recommended), pass an HTTP URL for Telegram to get a file from the Internet, or pass ‘attach://’ to upload a new one using multipart/form-data under name. More information on Sending Files

  • caption (str | None) – Caption of the photo to be sent, 0-1024 characters after entities parsing

  • parse_mode (str | None) – Mode for parsing entities in the photo caption. See formatting options for more details.

  • caption_entities (List[peyk.platforms.telegram.types.message_entity.MessageEntity] | None) – List of special entities that appear in the caption, which can be specified instead of parse_mode

  • show_caption_above_media (bool | None) – Pass True if the caption must be shown above the message media

  • has_spoiler (bool | None) – Pass True if the photo needs to be covered with a spoiler animation

media: object
caption: str | None = None
parse_mode: str | None = None
caption_entities: List[MessageEntity] | None = None
show_caption_above_media: bool | None = None
has_spoiler: bool | None = None
to_dict(media: str) Dict[str, object][source]

Provides the to dict operation for the Telegram integration.

Parameters:

media – Value used by this operation.

Returns:

Result produced by the operation.