pub struct ReplyKeyboardMarkupBuilder {
pub keyboard: Vec<Vec<KeyboardButton>>,
pub is_persistent: Option<bool>,
pub resize_keyboard: Option<bool>,
pub one_time_keyboard: Option<bool>,
pub input_field_placeholder: Option<String>,
pub selective: Option<bool>,
}Expand description
This object represents a custom keyboard with reply options (see Introduction to bots for details and examples). Not supported in channels and for messages sent on behalf of a Telegram Business account.
Fields§
§keyboard: Vec<Vec<KeyboardButton>>Array of button rows, each represented by an Array of KeyboardButton objects
is_persistent: Option<bool>Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
resize_keyboard: Option<bool>Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app’s standard keyboard.
one_time_keyboard: Option<bool>Optional. Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
input_field_placeholder: Option<String>Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
selective: Option<bool>Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message. Example: A user requests to change the bot’s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.
Implementations§
Source§impl ReplyKeyboardMarkupBuilder
impl ReplyKeyboardMarkupBuilder
pub fn new(keyboard: Vec<Vec<KeyboardButton>>) -> Self
Sourcepub fn set_keyboard(self, keyboard: Vec<Vec<KeyboardButton>>) -> Self
pub fn set_keyboard(self, keyboard: Vec<Vec<KeyboardButton>>) -> Self
Array of button rows, each represented by an Array of KeyboardButton objects
Sourcepub fn set_is_persistent(self, is_persistent: bool) -> Self
pub fn set_is_persistent(self, is_persistent: bool) -> Self
Optional. Requests clients to always show the keyboard when the regular keyboard is hidden. Defaults to false, in which case the custom keyboard can be hidden and opened with a keyboard icon.
Sourcepub fn set_resize_keyboard(self, resize_keyboard: bool) -> Self
pub fn set_resize_keyboard(self, resize_keyboard: bool) -> Self
Optional. Requests clients to resize the keyboard vertically for optimal fit (e.g., make the keyboard smaller if there are just two rows of buttons). Defaults to false, in which case the custom keyboard is always of the same height as the app’s standard keyboard.
Sourcepub fn set_one_time_keyboard(self, one_time_keyboard: bool) -> Self
pub fn set_one_time_keyboard(self, one_time_keyboard: bool) -> Self
Optional. Requests clients to hide the keyboard as soon as it’s been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to false.
Sourcepub fn set_input_field_placeholder(
self,
input_field_placeholder: String,
) -> Self
pub fn set_input_field_placeholder( self, input_field_placeholder: String, ) -> Self
Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
Sourcepub fn set_selective(self, selective: bool) -> Self
pub fn set_selective(self, selective: bool) -> Self
Optional. Use this parameter if you want to show the keyboard to specific users only. Targets: 1) users that are @mentioned in the text of the Message object; 2) if the bot’s message is a reply to a message in the same chat and forum topic, sender of the original message. Example: A user requests to change the bot’s language, bot replies to the request with a keyboard to select the new language. Other users in the group don’t see the keyboard.
pub fn build(self) -> ReplyKeyboardMarkup
Trait Implementations§
Source§impl Clone for ReplyKeyboardMarkupBuilder
impl Clone for ReplyKeyboardMarkupBuilder
Source§fn clone(&self) -> ReplyKeyboardMarkupBuilder
fn clone(&self) -> ReplyKeyboardMarkupBuilder
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ReplyKeyboardMarkupBuilder
impl Debug for ReplyKeyboardMarkupBuilder
Source§impl Default for ReplyKeyboardMarkupBuilder
impl Default for ReplyKeyboardMarkupBuilder
Source§fn default() -> ReplyKeyboardMarkupBuilder
fn default() -> ReplyKeyboardMarkupBuilder
Source§impl<'de> Deserialize<'de> for ReplyKeyboardMarkupBuilder
impl<'de> Deserialize<'de> for ReplyKeyboardMarkupBuilder
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Hash for ReplyKeyboardMarkupBuilder
impl Hash for ReplyKeyboardMarkupBuilder
Source§impl Ord for ReplyKeyboardMarkupBuilder
impl Ord for ReplyKeyboardMarkupBuilder
Source§fn cmp(&self, other: &ReplyKeyboardMarkupBuilder) -> Ordering
fn cmp(&self, other: &ReplyKeyboardMarkupBuilder) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for ReplyKeyboardMarkupBuilder
impl PartialOrd for ReplyKeyboardMarkupBuilder
impl Eq for ReplyKeyboardMarkupBuilder
impl StructuralPartialEq for ReplyKeyboardMarkupBuilder
Auto Trait Implementations§
impl Freeze for ReplyKeyboardMarkupBuilder
impl RefUnwindSafe for ReplyKeyboardMarkupBuilder
impl Send for ReplyKeyboardMarkupBuilder
impl Sync for ReplyKeyboardMarkupBuilder
impl Unpin for ReplyKeyboardMarkupBuilder
impl UnwindSafe for ReplyKeyboardMarkupBuilder
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.