mirror of
https://github.com/teloxide/teloxide.git
synced 2024-10-24 09:57:18 +02:00
Add setters to InlineQueryResultVoice
This commit is contained in:
parent
bc4ca24a80
commit
5044cf542b
1 changed files with 72 additions and 0 deletions
|
@ -45,3 +45,75 @@ pub struct InlineQueryResultVoice {
|
|||
/// Content of the message to be sent instead of the voice recording.
|
||||
pub input_message_content: Option<InputMessageContent>,
|
||||
}
|
||||
|
||||
impl InlineQueryResultVoice {
|
||||
pub fn new<S1, S2, S3>(id: S1, voice_url: S2, title: S3) -> Self
|
||||
where
|
||||
S1: Into<String>,
|
||||
S2: Into<String>,
|
||||
S3: Into<String>,
|
||||
{
|
||||
Self {
|
||||
id: id.into(),
|
||||
voice_url: voice_url.into(),
|
||||
title: title.into(),
|
||||
caption: None,
|
||||
parse_mode: None,
|
||||
voice_duration: None,
|
||||
reply_markup: None,
|
||||
input_message_content: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn id<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.id = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn voice_url<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.voice_url = val.into();
|
||||
self
|
||||
}
|
||||
|
||||
pub fn title<S>(mut self, val: S) -> Self
|
||||
where
|
||||
S: Into<String>,
|
||||
{
|
||||
self.title = val.into();
|
||||
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
|
||||
}
|
||||
|
||||
pub fn voice_duration(mut self, value: i32) -> Self {
|
||||
self.voice_duration = Some(value);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn reply_markup(mut self, val: InlineKeyboardMarkup) -> Self {
|
||||
self.reply_markup = Some(val);
|
||||
self
|
||||
}
|
||||
|
||||
pub fn input_message_content(mut self, val: InputMessageContent) -> Self {
|
||||
self.input_message_content = Some(val);
|
||||
self
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue