Enum telegram_types::bot::types::InputMedia[][src]

pub enum InputMedia {
    Video {
        media: FileToSend,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        width: Option<i32>,
        height: Option<i32>,
        duration: Option<i32>,
        supports_streaming: Option<bool>,
    },
    Photo {
        media: FileToSend,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
    },
    Animation {
        media: FileToSend,
        thumb: Option<InputFile>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        width: Option<i32>,
        height: Option<i32>,
        duration: Option<i32>,
    },
    Audio {
        media: FileToSend,
        thumb: Option<InputFile>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
        duration: Option<i32>,
        performer: Option<String>,
        title: Option<String>,
    },
    Document {
        media: FileToSend,
        thumb: Option<InputFile>,
        caption: Option<String>,
        parse_mode: Option<ParseMode>,
    },
    Unknown,
}

The content of a media message to be sent.

Variants

Video

Fields of Video

media: FileToSend

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.

More info on Sending Files

caption: Option<String>

Optional. Caption of the photo to be sent, 0-200 characters

parse_mode: Option<ParseMode>

Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.

width: Option<i32>height: Option<i32>duration: Option<i32>supports_streaming: Option<bool>

Pass True, if the uploaded video is suitable for streaming

Photo

Fields of Photo

media: FileToSend

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.

More info on Sending Files

caption: Option<String>

Optional. Caption of the photo to be sent, 0-200 characters

parse_mode: Option<ParseMode>

Optional. Send Markdown or HTML, if you want Telegram apps to show bold, italic, fixed-width text or inline URLs in the media caption.

Animation

Fields of Animation

media: FileToSend

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.

More info on Sending Files

thumb: Option<InputFile>

Thumbnail of the file sent.

The thumbnail should be in JPEG format and less than 200 kB in size.

A thumbnail‘s width and height should not exceed 90.

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>.

caption: Option<String>parse_mode: Option<ParseMode>width: Option<i32>height: Option<i32>duration: Option<i32>
Audio

Fields of Audio

media: FileToSendthumb: Option<InputFile>caption: Option<String>parse_mode: Option<ParseMode>duration: Option<i32>performer: Option<String>title: Option<String>
Document

Fields of Document

media: FileToSendthumb: Option<InputFile>caption: Option<String>parse_mode: Option<ParseMode>
Unknown

Unknown upstream data type.

Trait Implementations

impl Clone for InputMedia[src]

impl Debug for InputMedia[src]

impl<'de> Deserialize<'de> for InputMedia[src]

impl Eq for InputMedia[src]

impl PartialEq<InputMedia> for InputMedia[src]

impl Serialize for InputMedia[src]

impl StructuralEq for InputMedia[src]

impl StructuralPartialEq for InputMedia[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> DeserializeOwned for T where
    T: for<'de> Deserialize<'de>, 
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.