From 3a2003514cf188779af2f934d260fb15eadb21a2 Mon Sep 17 00:00:00 2001 From: Temirkhan Myrzamadi Date: Tue, 28 Jul 2020 19:17:46 +0600 Subject: [PATCH] Add setters to ReplyKeyboardMarkup --- src/types/reply_keyboard_markup.rs | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/types/reply_keyboard_markup.rs b/src/types/reply_keyboard_markup.rs index 8228b36d..a8d5983e 100644 --- a/src/types/reply_keyboard_markup.rs +++ b/src/types/reply_keyboard_markup.rs @@ -46,6 +46,19 @@ pub struct ReplyKeyboardMarkup { } impl ReplyKeyboardMarkup { + pub fn new(keyboard: K1) -> Self + where + K1: Into>, + K2: Into>, + { + 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) -> Self { self.keyboard.push(buttons); self