InputMedia

class aiogram.types.input_media.InputMedia(*args, **kwargs)[source]

Bases: aiogram.types.base.TelegramObject

This object represents the content of a media message to be sent. It should be one of
  • InputMediaAnimation

  • InputMediaDocument

  • InputMediaAudio

  • InputMediaPhoto

  • InputMediaVideo

That is only base class.

https://core.telegram.org/bots/api#inputmedia

Deserialize object

Parameters
  • conf

  • kwargs

InputMediaAnimation

class aiogram.types.input_media.InputMediaAnimation(media: aiogram.types.base.InputFile, thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, width: Optional[aiogram.types.base.Integer] = None, height: Optional[aiogram.types.base.Integer] = None, duration: Optional[aiogram.types.base.Integer] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, **kwargs)[source]

Bases: aiogram.types.input_media.InputMedia

Represents an animation file (GIF or H.264/MPEG-4 AVC video without sound) to be sent.

https://core.telegram.org/bots/api#inputmediaanimation

Deserialize object

Parameters
  • conf

  • kwargs

InputMediaDocument

class aiogram.types.input_media.InputMediaDocument(media: aiogram.types.base.InputFile, thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, disable_content_type_detection: Optional[aiogram.types.base.Boolean] = None, **kwargs)[source]

Bases: aiogram.types.input_media.InputMedia

Represents a general file to be sent.

https://core.telegram.org/bots/api#inputmediadocument

Deserialize object

Parameters
  • conf

  • kwargs

InputMediaAudio

class aiogram.types.input_media.InputMediaAudio(media: aiogram.types.base.InputFile, thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, duration: Optional[aiogram.types.base.Integer] = None, performer: Optional[aiogram.types.base.String] = None, title: Optional[aiogram.types.base.String] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, **kwargs)[source]

Bases: aiogram.types.input_media.InputMedia

Represents an audio file to be treated as music to be sent.

https://core.telegram.org/bots/api#inputmediaaudio

Deserialize object

Parameters
  • conf

  • kwargs

InputMediaPhoto

class aiogram.types.input_media.InputMediaPhoto(media: aiogram.types.base.InputFile, caption: Optional[aiogram.types.base.String] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, **kwargs)[source]

Bases: aiogram.types.input_media.InputMedia

Represents a photo to be sent.

https://core.telegram.org/bots/api#inputmediaphoto

Deserialize object

Parameters
  • conf

  • kwargs

InputMediaVideo

class aiogram.types.input_media.InputMediaVideo(media: aiogram.types.base.InputFile, thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, width: Optional[aiogram.types.base.Integer] = None, height: Optional[aiogram.types.base.Integer] = None, duration: Optional[aiogram.types.base.Integer] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, supports_streaming: Optional[aiogram.types.base.Boolean] = None, **kwargs)[source]

Bases: aiogram.types.input_media.InputMedia

Represents a video to be sent.

https://core.telegram.org/bots/api#inputmediavideo

Deserialize object

Parameters
  • conf

  • kwargs

MediaGroup

class aiogram.types.input_media.MediaGroup(medias: Optional[List[Union[aiogram.types.input_media.InputMedia, Dict]]] = None)[source]

Bases: aiogram.types.base.TelegramObject

Helper for sending media group

Deserialize object

Parameters
  • conf

  • kwargs

attach_many(*medias: Union[aiogram.types.input_media.InputMedia, Dict])[source]

Attach list of media

Parameters

medias

attach(media: Union[aiogram.types.input_media.InputMedia, Dict])[source]

Attach media

Parameters

media

attach_audio(audio: Union[aiogram.types.input_media.InputMediaAudio, aiogram.types.base.InputFile], thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, duration: Optional[aiogram.types.base.Integer] = None, performer: Optional[aiogram.types.base.String] = None, title: Optional[aiogram.types.base.String] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None)[source]

Attach audio

Parameters
  • audio

  • thumb

  • caption

  • duration

  • performer

  • title

  • parse_mode

  • caption_entities

attach_document(document: Union[aiogram.types.input_media.InputMediaDocument, aiogram.types.base.InputFile], thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, disable_content_type_detection: Optional[aiogram.types.base.Boolean] = None)[source]

Attach document

Parameters
  • document

  • caption

  • thumb

  • parse_mode

  • caption_entities

  • disable_content_type_detection

attach_photo(photo: Union[aiogram.types.input_media.InputMediaPhoto, aiogram.types.base.InputFile], caption: Optional[aiogram.types.base.String] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None)[source]

Attach photo

Parameters
  • photo

  • caption

  • parse_mode

  • caption_entities

attach_video(video: Union[aiogram.types.input_media.InputMediaVideo, aiogram.types.base.InputFile], thumb: Optional[Union[aiogram.types.base.InputFile, aiogram.types.base.String]] = None, caption: Optional[aiogram.types.base.String] = None, width: Optional[aiogram.types.base.Integer] = None, height: Optional[aiogram.types.base.Integer] = None, duration: Optional[aiogram.types.base.Integer] = None, parse_mode: Optional[aiogram.types.base.String] = None, caption_entities: Optional[List[aiogram.types.message_entity.MessageEntity]] = None, supports_streaming: Optional[aiogram.types.base.Boolean] = None)[source]

Attach video

Parameters
  • video

  • thumb

  • caption

  • width

  • height

  • duration

  • parse_mode

  • caption_entities

  • supports_streaming

to_python() List[source]

Get object as JSON serializable

Returns