telegram.InputMedia

class telegram.InputMedia(media_type, media, caption=None, caption_entities=None, parse_mode=None, *, api_kwargs=None)[source]

Bases: telegram.TelegramObject

Base class for Telegram InputMedia Objects.

Changed in version 20.0:: Added arguments and attributes type, media, caption, caption_entities, parse_mode.

Parameters
type[source]

Type of the input media.

Type

str

media[source]

Media to send.

Type

str | telegram.InputFile

caption[source]

Optional. Caption of the media to be sent.

Type

str

parse_mode[source]

Optional. The parse mode to use for text formatting.

Type

str

caption_entities[source]

Optional. List of special entities that appear in the caption.

Type

List[telegram.MessageEntity]