mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Add setters to MediaAudio
This commit is contained in:
parent
56f02a32c8
commit
7aaa7eaf64
1 changed files with 30 additions and 0 deletions
|
@ -626,6 +626,36 @@ pub struct MediaAudio {
|
|||
pub caption_entities: Vec<MessageEntity>,
|
||||
}
|
||||
|
||||
impl MediaAudio {
|
||||
pub fn new<CE>(audio: Audio, caption_entities: CE) -> Self
|
||||
where
|
||||
CE: Into<Vec<MessageEntity>>,
|
||||
{
|
||||
Self { audio, caption: None, caption_entities: caption_entities.into() }
|
||||
}
|
||||
|
||||
pub fn audio(mut self, val: Audio) -> Self {
|
||||
self.audio = 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
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Clone, Debug, PartialEq, Serialize, Deserialize)]
|
||||
#[non_exhaustive]
|
||||
pub struct MediaContact {
|
||||
|
|
Loading…
Reference in a new issue