mirror of
https://github.com/teloxide/teloxide.git
synced 2025-01-08 19:33:53 +01:00
Add setters to ReplyKeyboardMarkup
This commit is contained in:
parent
c33fc9b492
commit
3a2003514c
1 changed files with 13 additions and 0 deletions
|
@ -46,6 +46,19 @@ pub struct ReplyKeyboardMarkup {
|
|||
}
|
||||
|
||||
impl ReplyKeyboardMarkup {
|
||||
pub fn new<K1, K2>(keyboard: K1) -> Self
|
||||
where
|
||||
K1: Into<Vec<K2>>,
|
||||
K2: Into<Vec<KeyboardButton>>,
|
||||
{
|
||||
Self {
|
||||
keyboard: keyboard.into().into_iter().map(Into::into).collect(),
|
||||
resize_keyboard: None,
|
||||
one_time_keyboard: None,
|
||||
selective: None,
|
||||
}
|
||||
}
|
||||
|
||||
pub fn append_row(mut self, buttons: Vec<KeyboardButton>) -> Self {
|
||||
self.keyboard.push(buttons);
|
||||
self
|
||||
|
|
Loading…
Reference in a new issue