Enum telbot_types::file::InputMedia[][src]

pub enum InputMedia {
    Photo {
        media: String,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        caption_entities: Option<Vec<MessageEntity>>,
    },
    Video {
        media: String,
        thumb: Option<InputFileVariant>,
        width: Option<u32>,
        height: Option<u32>,
        duration: Option<u32>,
        supports_streaming: Option<bool>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        caption_entities: Option<Vec<MessageEntity>>,
    },
    Animation {
        media: String,
        thumb: Option<InputFileVariant>,
        width: Option<u32>,
        height: Option<u32>,
        duration: Option<u32>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        caption_entities: Option<Vec<MessageEntity>>,
    },
    Audio {
        media: String,
        thumb: Option<InputFileVariant>,
        performer: Option<String>,
        title: Option<String>,
        duration: Option<u32>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        caption_entities: Option<Vec<MessageEntity>>,
    },
    Document {
        media: String,
        thumb: Option<InputFileVariant>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        caption_entities: Option<Vec<MessageEntity>>,
    },
}
Expand description

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

  • InputMediaAnimation
  • InputMediaDocument
  • InputMediaAudio
  • InputMediaPhoto
  • InputMediaVideo

Variants

Photo

Represents a photo to be sent.

Fields of Photo

media: String

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://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.

caption: Option<String>

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

parse_mode: Option<ParseMode>

Mode for parsing entities in the photo caption. See formatting options for more details.

caption_entities: Option<Vec<MessageEntity>>

List of special entities that appear in the caption, which can be specified instead of parse_mode

Video

Represents a video to be sent.

Fields of Video

media: String

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://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.

thumb: Option<InputFileVariant>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »

width: Option<u32>

Video width

height: Option<u32>

Video height

duration: Option<u32>

Video duration

supports_streaming: Option<bool>

Pass True, if the uploaded video is suitable for streaming

caption: Option<String>

Caption of the video to be sent, 0-1024 characters after entities parsing

parse_mode: Option<ParseMode>

Mode for parsing entities in the video caption. See formatting options for more details.

caption_entities: Option<Vec<MessageEntity>>

List of special entities that appear in the caption, which can be specified instead of parse_mode

Animation

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

Fields of Animation

media: String

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://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.

thumb: Option<InputFileVariant>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »

width: Option<u32>

Animation width

height: Option<u32>

Animation height

duration: Option<u32>

Animation duration

caption: Option<String>

Caption of the animation to be sent, 0-1024 characters after entities parsing

parse_mode: Option<ParseMode>

Mode for parsing entities in the animation caption. See formatting options for more details.

caption_entities: Option<Vec<MessageEntity>>

List of special entities that appear in the caption, which can be specified instead of parse_mode

Audio

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

Fields of Audio

media: String

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://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.

thumb: Option<InputFileVariant>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »

performer: Option<String>

Performer of the audio

title: Option<String>

Title of the audio

duration: Option<u32>

Duration of the audio in seconds

caption: Option<String>

Caption of the audio to be sent, 0-1024 characters after entities parsing

parse_mode: Option<ParseMode>

Mode for parsing entities in the audio caption. See formatting options for more details.

caption_entities: Option<Vec<MessageEntity>>

List of special entities that appear in the caption, which can be specified instead of parse_mode

Document

Represents a general file to be sent.

Fields of Document

media: String

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://<file_attach_name>” to upload a new one using multipart/form-data under <file_attach_name> name.

thumb: Option<InputFileVariant>

Thumbnail of the file sent; can be ignored if thumbnail generation for the file is supported server-side. The thumbnail should be in JPEG format and less than 200 kB in size. A thumbnail’s width and height should not exceed 320. Ignored if the file is not uploaded using multipart/form-data. Thumbnails can’t be reused and can be only uploaded as a new file, so you can pass “attach://<file_attach_name>” if the thumbnail was uploaded using multipart/form-data under <file_attach_name>. More info on Sending Files »

caption: Option<String>

Caption of the document to be sent, 0-1024 characters after entities parsing

parse_mode: Option<ParseMode>

Mode for parsing entities in the document caption. See formatting options for more details.

caption_entities: Option<Vec<MessageEntity>>

List of special entities that appear in the caption, which can be specified instead of parse_mode

Trait Implementations

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.