diff --git a/src/types/message.rs b/src/types/message.rs index a03cbf47..e54401b5 100644 --- a/src/types/message.rs +++ b/src/types/message.rs @@ -779,6 +779,53 @@ pub struct MediaPhoto { pub media_group_id: Option, } +impl MediaPhoto { + pub fn new(photo: P, caption_entities: CE) -> Self + where + P: Into>, + CE: Into>, + { + Self { + photo: photo.into(), + caption: None, + caption_entities: caption_entities.into(), + media_group_id: None, + } + } + + pub fn photo

(mut self, val: P) -> Self + where + P: Into>, + { + self.photo = val.into(); + self + } + + pub fn caption(mut self, val: S) -> Self + where + S: Into, + { + self.caption = Some(val.into()); + self + } + + pub fn caption_entities(mut self, val: CE) -> Self + where + CE: Into>, + { + self.caption_entities = val.into(); + self + } + + pub fn media_group_id(mut self, val: S) -> Self + where + S: Into, + { + self.media_group_id = Some(val.into()); + self + } +} + #[derive(Clone, Debug, PartialEq, Serialize, Deserialize)] #[non_exhaustive] pub struct MediaPoll {