mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Add setters to InputMediaVideo
This commit is contained in:
parent
f4d1c03c17
commit
c775c3c2b7
1 changed files with 58 additions and 0 deletions
|
@ -104,6 +104,64 @@ pub struct InputMediaVideo {
|
|||
pub supports_streaming: Option<bool>,
|
||||
}
|
||||
|
||||
impl InputMediaVideo {
|
||||
pub fn new(media: InputFile) -> Self {
|
||||
Self {
|
||||
media,
|
||||
thumb: None,
|
||||
caption: None,
|
||||
parse_mode: None,
|
||||
width: None,
|
||||
height: None,
|
||||
duration: None,
|
||||
supports_streaming: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn media(mut self, val: InputFile) -> Self {
|
||||
self.media = val;
|
||||
self
|
||||
}
|
||||
|
||||
pub fn thumb(mut self, val: InputFile) -> Self {
|
||||
self.thumb = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn caption<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.caption = Some(val.into());
|
||||
self
|
||||
}
|
||||
|
||||
pub fn parse_mode(mut self, val: ParseMode) -> Self {
|
||||
self.parse_mode = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn width(mut self, val: u16) -> Self {
|
||||
self.width = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn height(mut self, val: u16) -> Self {
|
||||
self.height = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn duration(mut self, val: u16) -> Self {
|
||||
self.duration = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn supports_streaming(mut self, val: bool) -> Self {
|
||||
self.supports_streaming = Some(val);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
||||
/// Represents an animation file (GIF or H.264/MPEG-4 AVC video without
|
||||
/// sound) to be sent.
|
||||
///
|
||||
|
|
Loading…
Reference in a new issue