mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
Add setters to InlineQueryResultGame
This commit is contained in:
parent
d7336fe2cb
commit
22a370e4c8
1 changed files with 31 additions and 0 deletions
|
@ -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
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue