Add setters to InlineQueryResultGif
@@ -53,3 +53,96 @@ pub struct InlineQueryResultGif {
/// Content of the message to be sent instead of the GIF animation.
pub input_message_content: Option<InputMessageContent>,
}
+
+impl InlineQueryResultGif {
+ pub fn new<S1, S2, S3>(id: S1, gif_url: S2, thumb_url: S3) -> Self
+ where
+ S1: Into<String>,
+ S2: Into<String>,
+ S3: Into<String>,
+ {
+ Self {
+ id: id.into(),
+ gif_url: gif_url.into(),
+ gif_width: None,
+ gif_height: None,
+ gif_duration: None,
+ thumb_url: thumb_url.into(),
+ title: None,
+ caption: None,
+ parse_mode: 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 gif_url<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.gif_url = val.into();
+ self
+ }
+
+ pub fn gif_width(mut self, val: i32) -> Self {
+ self.gif_width = Some(val);
+ self
+ }
+
+ pub fn gif_height(mut self, val: i32) -> Self {
+ self.gif_height = Some(val);
+ self
+ }
+
+ pub fn gif_duration(mut self, val: i32) -> Self {
+ self.gif_duration = Some(val);
+ self
+ }
+
+ pub fn thumb_url<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.thumb_url = val.into();
+ self
+ }
+
+ pub fn title<S>(mut self, val: S) -> Self
+ where
+ S: Into<String>,
+ {
+ self.title = Some(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 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
+ }
+}
