Add setters to InlineQueryResultCachedSticker

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 19:54:47 +06:00
parent 3fcc7aefd7
commit fa0a673919

View file

@ -27,3 +27,44 @@ pub struct InlineQueryResultCachedSticker {
/// Content of the message to be sent instead of the sticker.
pub input_message_content: Option<InputMessageContent>,
}
impl InlineQueryResultCachedSticker {
pub fn new<S1, S2>(id: S1, sticker_file_id: S2) -> Self
where
S1: Into<String>,
S2: Into<String>,
{
Self {
id: id.into(),
sticker_file_id: sticker_file_id.into(),
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 sticker_file_id<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.sticker_file_id = val.into();
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
}
}