mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-10 20:12:25 +01:00
Add setters to InputMediaDocument
This commit is contained in:
parent
9d3cf70677
commit
1fb3b95dca
1 changed files with 24 additions and 0 deletions
|
@ -378,6 +378,30 @@ pub struct InputMediaDocument {
|
||||||
pub parse_mode: Option<ParseMode>,
|
pub parse_mode: Option<ParseMode>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl InputMediaDocument {
|
||||||
|
pub fn new(media: InputFile) -> Self {
|
||||||
|
Self { media, thumb: None, caption: None, parse_mode: None }
|
||||||
|
}
|
||||||
|
|
||||||
|
pub fn thumb(mut self, val: InputFile) -> Self {
|
||||||
|
self.thumb = Some(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
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
impl InputMedia {
|
impl InputMedia {
|
||||||
pub fn media(&self) -> &InputFile {
|
pub fn media(&self) -> &InputFile {
|
||||||
match self {
|
match self {
|
||||||
|
|
Loading…
Reference in a new issue