mirror of
https://github.com/teloxide/teloxide.git
synced 2025-03-24 23:57:38 +01:00
Add setters to MediaVideo
This commit is contained in:
parent
248c7396f5
commit
207527086e
1 changed files with 43 additions and 0 deletions
|
@ -921,6 +921,49 @@ pub struct MediaVideo {
|
||||||
pub media_group_id: Option<String>,
|
pub media_group_id: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl MediaVideo {
|
||||||
|
pub fn new<CE>(video: Video, caption_entities: CE) -> Self
|
||||||
|
where
|
||||||
|
CE: Into<Vec<MessageEntity>>,
|
||||||
|
{
|
||||||
|
Self {
|
||||||
|
video,
|
||||||
|
caption: None,
|
||||||
|
caption_entities: caption_entities.into(),
|
||||||
|
media_group_id: None,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn video(mut self, val: Video) -> Self {
|
||||||
|
self.video = val;
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn caption<S>(mut self, val: S) -> Self
|
||||||
|
where
|
||||||
|
S: Into<String>,
|
||||||
|
{
|
||||||
|
self.caption = Some(val.into());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn caption_entities<CE>(mut self, val: CE) -> Self
|
||||||
|
where
|
||||||
|
CE: Into<Vec<MessageEntity>>,
|
||||||
|
{
|
||||||
|
self.caption_entities = val.into();
|
||||||
|
self
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn media_group_id<S>(mut self, val: S) -> Self
|
||||||
|
where
|
||||||
|
S: Into<String>,
|
||||||
|
{
|
||||||
|
self.media_group_id = Some(val.into());
|
||||||
|
self
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||||
#[non_exhaustive]
|
#[non_exhaustive]
|
||||||
pub struct MediaVideoNote {
|
pub struct MediaVideoNote {
|
||||||
|
|
Loading…
Add table
Reference in a new issue