mirror of
https://github.com/teloxide/teloxide.git
synced 2024-12-23 06:51:01 +01:00
Add setters to InputMediaPhoto
This commit is contained in:
parent
5044cf542b
commit
9e547766ad
1 changed files with 24 additions and 0 deletions
|
@ -38,6 +38,30 @@ pub struct InputMediaPhoto {
|
|||
pub parse_mode: Option<ParseMode>,
|
||||
}
|
||||
|
||||
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<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
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).
|
||||
|
|
Loading…
Reference in a new issue