diff --git a/src/types/input_media.rs b/src/types/input_media.rs index 4a2c9e6f..a37ebda4 100644 --- a/src/types/input_media.rs +++ b/src/types/input_media.rs @@ -378,6 +378,30 @@ pub struct InputMediaDocument { pub parse_mode: Option, } +impl InputMediaDocument { + pub fn new(media: InputFile) -> Self { + Self { media, thumb: None, caption: None, parse_mode: None } + } + + pub fn thumb(mut self, val: InputFile) -> Self { + self.thumb = Some(val); + self + } + + pub fn caption(mut self, val: S) -> Self + where + S: Into, + { + self.caption = Some(val.into()); + self + } + + pub fn parse_mode(mut self, val: ParseMode) -> Self { + self.parse_mode = Some(val); + self + } +} + impl InputMedia { pub fn media(&self) -> &InputFile { match self {