Struct botapi::gen_types::InputMediaAudio
source · pub struct InputMediaAudio {
pub tg_type: String,
pub media: Option<InputFile>,
pub thumbnail: Option<InputFile>,
pub caption: Option<String>,
pub parse_mode: Option<String>,
pub caption_entities: Option<Vec<MessageEntity>>,
pub duration: Option<i64>,
pub performer: Option<String>,
pub title: Option<String>,
}
Expand description
Represents an audio file to be treated as music to be sent.
Fields§
§tg_type: String
Type of the result, must be audio
media: Option<InputFile>
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 information on Sending Files: https://core.telegram.org/bots/api#sending-files
thumbnail: Option<InputFile>
Optional. 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 information on Sending Files: https://core.telegram.org/bots/api#sending-files
caption: Option<String>
Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
parse_mode: Option<String>
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
caption_entities: Option<Vec<MessageEntity>>
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
duration: Option<i64>
Optional. Duration of the audio in seconds
performer: Option<String>
Optional. Performer of the audio
title: Option<String>
Optional. Title of the audio
Implementations§
source§impl InputMediaAudio
impl InputMediaAudio
pub fn noskip(self) -> NoSkipInputMediaAudio
source§impl InputMediaAudio
impl InputMediaAudio
pub fn new(media: Option<InputFile>) -> Self
sourcepub fn get_tg_type<'a>(&'a self) -> &'a str
pub fn get_tg_type<'a>(&'a self) -> &'a str
Type of the result, must be audio
sourcepub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self
pub fn set_tg_type<'a>(&'a mut self, tg_type: String) -> &'a mut Self
Type of the result, must be audio
sourcepub fn get_media<'a>(&'a self) -> &'a Option<InputFile>
pub fn get_media<'a>(&'a self) -> &'a Option<InputFile>
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 information on Sending Files: https://core.telegram.org/bots/api#sending-files
sourcepub fn set_media<'a>(&'a mut self, media: Option<InputFile>) -> &'a mut Self
pub fn set_media<'a>(&'a mut self, media: Option<InputFile>) -> &'a mut Self
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 information on Sending Files: https://core.telegram.org/bots/api#sending-files
sourcepub fn get_thumbnail<'a>(&'a self) -> Option<&'a InputFile>
pub fn get_thumbnail<'a>(&'a self) -> Option<&'a InputFile>
Optional. 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 information on Sending Files: https://core.telegram.org/bots/api#sending-files
sourcepub fn set_thumbnail<'a>(
&'a mut self,
thumbnail: Option<InputFile>,
) -> &'a mut Self
pub fn set_thumbnail<'a>( &'a mut self, thumbnail: Option<InputFile>, ) -> &'a mut Self
Optional. 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 information on Sending Files: https://core.telegram.org/bots/api#sending-files
sourcepub fn get_caption<'a>(&'a self) -> Option<&'a str>
pub fn get_caption<'a>(&'a self) -> Option<&'a str>
Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
sourcepub fn set_caption<'a>(&'a mut self, caption: Option<String>) -> &'a mut Self
pub fn set_caption<'a>(&'a mut self, caption: Option<String>) -> &'a mut Self
Optional. Caption of the audio to be sent, 0-1024 characters after entities parsing
sourcepub fn get_parse_mode<'a>(&'a self) -> Option<&'a str>
pub fn get_parse_mode<'a>(&'a self) -> Option<&'a str>
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
sourcepub fn set_parse_mode<'a>(
&'a mut self,
parse_mode: Option<String>,
) -> &'a mut Self
pub fn set_parse_mode<'a>( &'a mut self, parse_mode: Option<String>, ) -> &'a mut Self
Optional. Mode for parsing entities in the audio caption. See formatting options for more details.
sourcepub fn get_caption_entities<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>
pub fn get_caption_entities<'a>(&'a self) -> Option<&'a Vec<MessageEntity>>
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
sourcepub fn set_caption_entities<'a>(
&'a mut self,
caption_entities: Option<Vec<MessageEntity>>,
) -> &'a mut Self
pub fn set_caption_entities<'a>( &'a mut self, caption_entities: Option<Vec<MessageEntity>>, ) -> &'a mut Self
Optional. List of special entities that appear in the caption, which can be specified instead of parse_mode
sourcepub fn get_duration<'a>(&'a self) -> Option<i64>
pub fn get_duration<'a>(&'a self) -> Option<i64>
Optional. Duration of the audio in seconds
sourcepub fn set_duration<'a>(&'a mut self, duration: Option<i64>) -> &'a mut Self
pub fn set_duration<'a>(&'a mut self, duration: Option<i64>) -> &'a mut Self
Optional. Duration of the audio in seconds
sourcepub fn get_performer<'a>(&'a self) -> Option<&'a str>
pub fn get_performer<'a>(&'a self) -> Option<&'a str>
Optional. Performer of the audio
sourcepub fn set_performer<'a>(
&'a mut self,
performer: Option<String>,
) -> &'a mut Self
pub fn set_performer<'a>( &'a mut self, performer: Option<String>, ) -> &'a mut Self
Optional. Performer of the audio
sourcepub fn set_title<'a>(&'a mut self, title: Option<String>) -> &'a mut Self
pub fn set_title<'a>(&'a mut self, title: Option<String>) -> &'a mut Self
Optional. Title of the audio
Trait Implementations§
source§impl Clone for InputMediaAudio
impl Clone for InputMediaAudio
source§fn clone(&self) -> InputMediaAudio
fn clone(&self) -> InputMediaAudio
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InputMediaAudio
impl Debug for InputMediaAudio
source§impl Default for InputMediaAudio
impl Default for InputMediaAudio
source§fn default() -> InputMediaAudio
fn default() -> InputMediaAudio
source§impl<'de> Deserialize<'de> for InputMediaAudio
impl<'de> Deserialize<'de> for InputMediaAudio
source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
source§impl From<BoxWrapper<Box<InputMediaAudio>>> for InputMediaAudio
impl From<BoxWrapper<Box<InputMediaAudio>>> for InputMediaAudio
source§fn from(t: BoxWrapper<Box<InputMediaAudio>>) -> Self
fn from(t: BoxWrapper<Box<InputMediaAudio>>) -> Self
source§impl From<BoxWrapper<Unbox<InputMediaAudio>>> for InputMediaAudio
impl From<BoxWrapper<Unbox<InputMediaAudio>>> for InputMediaAudio
source§fn from(t: BoxWrapper<Unbox<InputMediaAudio>>) -> Self
fn from(t: BoxWrapper<Unbox<InputMediaAudio>>) -> Self
source§impl From<NoSkipInputMediaAudio> for InputMediaAudio
impl From<NoSkipInputMediaAudio> for InputMediaAudio
source§fn from(t: NoSkipInputMediaAudio) -> Self
fn from(t: NoSkipInputMediaAudio) -> Self
source§impl Hash for InputMediaAudio
impl Hash for InputMediaAudio
source§impl Into<NoSkipInputMediaAudio> for InputMediaAudio
impl Into<NoSkipInputMediaAudio> for InputMediaAudio
source§fn into(self) -> NoSkipInputMediaAudio
fn into(self) -> NoSkipInputMediaAudio
source§impl Ord for InputMediaAudio
impl Ord for InputMediaAudio
source§fn cmp(&self, other: &InputMediaAudio) -> Ordering
fn cmp(&self, other: &InputMediaAudio) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for InputMediaAudio
impl PartialEq for InputMediaAudio
source§fn eq(&self, other: &InputMediaAudio) -> bool
fn eq(&self, other: &InputMediaAudio) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for InputMediaAudio
impl PartialOrd for InputMediaAudio
source§fn partial_cmp(&self, other: &InputMediaAudio) -> Option<Ordering>
fn partial_cmp(&self, other: &InputMediaAudio) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for InputMediaAudio
impl Serialize for InputMediaAudio
impl Eq for InputMediaAudio
impl StructuralPartialEq for InputMediaAudio
Auto Trait Implementations§
impl Freeze for InputMediaAudio
impl RefUnwindSafe for InputMediaAudio
impl Send for InputMediaAudio
impl Sync for InputMediaAudio
impl Unpin for InputMediaAudio
impl UnwindSafe for InputMediaAudio
Blanket Implementations§
source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
source§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.