pub enum InputMedia {
InputMediaAnimation(InputMediaAnimation),
InputMediaDocument(InputMediaDocument),
InputMediaAudio(InputMediaAudio),
InputMediaPhoto(InputMediaPhoto),
InputMediaVideo(InputMediaVideo),
}
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§
InputMediaAnimation(InputMediaAnimation)
InputMediaDocument(InputMediaDocument)
InputMediaAudio(InputMediaAudio)
InputMediaPhoto(InputMediaPhoto)
InputMediaVideo(InputMediaVideo)
Implementations§
Source§impl InputMedia
impl InputMedia
Sourcepub fn prepare_input_media_param(&self, idx: i32) -> Self
pub fn prepare_input_media_param(&self, idx: i32) -> Self
prepare_input_media_param evaluates a single InputMedia and determines if it needs to be modified for a successful upload. If it returns nil, then the value does not need to be included in the params. Otherwise, it will return the same type as was originally provided.
The idx is used to calculate the file field name. If you only have a single file, 0 may be used. It is formatted into “attach://file-%d” for the primary media and “attach://file-%d-thumb” for thumbnails.
It is expected to be used in conjunction with prepareInputMediaFile.
Sourcepub fn prepare_input_media_file(&self, idx: i32) -> Vec<(String, InputFile)>
pub fn prepare_input_media_file(&self, idx: i32) -> Vec<(String, InputFile)>
prepare_input_media_file generates an array of RequestFile to provide for Fileable’s files method. It returns an array as a single InputMedia may have multiple files, for the primary media and a thumbnail.
The idx parameter is used to generate file field names. It uses the names “file-%d” for the main file and “file-%d-thumb” for the thumbnail.
It is expected to be used in conjunction with prepareInputMediaParam.
Trait Implementations§
Source§impl Clone for InputMedia
impl Clone for InputMedia
Source§fn clone(&self) -> InputMedia
fn clone(&self) -> InputMedia
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read more