diff --git a/src/types/inline_query_result_voice.rs b/src/types/inline_query_result_voice.rs index 4cae0068..db812b7e 100644 --- a/src/types/inline_query_result_voice.rs +++ b/src/types/inline_query_result_voice.rs @@ -45,3 +45,75 @@ pub struct InlineQueryResultVoice { /// Content of the message to be sent instead of the voice recording. pub input_message_content: Option, } + +impl InlineQueryResultVoice { + pub fn new(id: S1, voice_url: S2, title: S3) -> Self + where + S1: Into, + S2: Into, + S3: Into, + { + 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(mut self, val: S) -> Self + where + S: Into, + { + self.id = val.into(); + self + } + + pub fn voice_url(mut self, val: S) -> Self + where + S: Into, + { + self.voice_url = val.into(); + self + } + + pub fn title(mut self, val: S) -> Self + where + S: Into, + { + self.title = val.into(); + self + } + + pub fn caption(mut self, val: S) -> Self + where + S: Into, + { + 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 + } +}