Add setters to InlineQueryResultGame

This commit is contained in:
Temirkhan Myrzamadi 2020-07-27 20:10:14 +06:00
parent d7336fe2cb
commit 22a370e4c8

View file

@ -22,3 +22,34 @@ pub struct InlineQueryResultGame {
/// [Inline keyboard]: https://core.telegram.org/bots#inline-keyboards-and-on-the-fly-updating
pub reply_markup: Option<InlineKeyboardMarkup>,
}
impl InlineQueryResultGame {
pub fn new<S1, S2>(id: S1, game_short_name: S2) -> Self
where
S1: Into<String>,
S2: Into<String>,
{
Self { id: id.into(), game_short_name: game_short_name.into(), reply_markup: None }
}
pub fn id<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.id = val.into();
self
}
pub fn game_short_name<S>(mut self, val: S) -> Self
where
S: Into<String>,
{
self.game_short_name = val.into();
self
}
pub fn reply_markup(mut self, val: InlineKeyboardMarkup) -> Self {
self.reply_markup = Some(val);
self
}
}