diff --git a/src/types/input_media.rs b/src/types/input_media.rs index 78ece953..00effaea 100644 --- a/src/types/input_media.rs +++ b/src/types/input_media.rs @@ -38,6 +38,30 @@ pub struct InputMediaPhoto { pub parse_mode: Option, } +impl InputMediaPhoto { + pub fn new(media: InputFile) -> Self { + Self { media, caption: None, parse_mode: None } + } + + pub fn media(mut self, val: InputFile) -> Self { + self.media = 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 + } +} + /// Represents a video to be sent. /// /// [The official docs](https://core.telegram.org/bots/api#inputmediavideo).