Struct botapi::gen_types::ReplyKeyboardMarkup
source · pub struct ReplyKeyboardMarkup {
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 ReplyKeyboardMarkup
impl ReplyKeyboardMarkup
pub fn noskip(self) -> NoSkipReplyKeyboardMarkup
source§impl ReplyKeyboardMarkup
impl ReplyKeyboardMarkup
pub fn new(keyboard: Vec<Vec<KeyboardButton>>) -> Self
sourcepub fn get_keyboard<'a>(&'a self) -> &'a Vec<Vec<KeyboardButton>>
pub fn get_keyboard<'a>(&'a self) -> &'a Vec<Vec<KeyboardButton>>
Array of button rows, each represented by an Array of KeyboardButton objects
sourcepub fn set_keyboard<'a>(
&'a mut self,
keyboard: Vec<Vec<KeyboardButton>>,
) -> &'a mut Self
pub fn set_keyboard<'a>( &'a mut self, keyboard: Vec<Vec<KeyboardButton>>, ) -> &'a mut Self
Array of button rows, each represented by an Array of KeyboardButton objects
sourcepub fn get_is_persistent<'a>(&'a self) -> Option<bool>
pub fn get_is_persistent<'a>(&'a self) -> 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.
sourcepub fn set_is_persistent<'a>(
&'a mut self,
is_persistent: Option<bool>,
) -> &'a mut Self
pub fn set_is_persistent<'a>( &'a mut self, is_persistent: Option<bool>, ) -> &'a mut 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 get_resize_keyboard<'a>(&'a self) -> Option<bool>
pub fn get_resize_keyboard<'a>(&'a self) -> 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.
sourcepub fn set_resize_keyboard<'a>(
&'a mut self,
resize_keyboard: Option<bool>,
) -> &'a mut Self
pub fn set_resize_keyboard<'a>( &'a mut self, resize_keyboard: Option<bool>, ) -> &'a mut 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 get_one_time_keyboard<'a>(&'a self) -> Option<bool>
pub fn get_one_time_keyboard<'a>(&'a self) -> 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.
sourcepub fn set_one_time_keyboard<'a>(
&'a mut self,
one_time_keyboard: Option<bool>,
) -> &'a mut Self
pub fn set_one_time_keyboard<'a>( &'a mut self, one_time_keyboard: Option<bool>, ) -> &'a mut 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 get_input_field_placeholder<'a>(&'a self) -> Option<&'a str>
pub fn get_input_field_placeholder<'a>(&'a self) -> Option<&'a str>
Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
sourcepub fn set_input_field_placeholder<'a>(
&'a mut self,
input_field_placeholder: Option<String>,
) -> &'a mut Self
pub fn set_input_field_placeholder<'a>( &'a mut self, input_field_placeholder: Option<String>, ) -> &'a mut Self
Optional. The placeholder to be shown in the input field when the keyboard is active; 1-64 characters
sourcepub fn get_selective<'a>(&'a self) -> Option<bool>
pub fn get_selective<'a>(&'a self) -> 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.
sourcepub fn set_selective<'a>(&'a mut self, selective: Option<bool>) -> &'a mut Self
pub fn set_selective<'a>(&'a mut self, selective: Option<bool>) -> &'a mut 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.
Trait Implementations§
source§impl Clone for ReplyKeyboardMarkup
impl Clone for ReplyKeyboardMarkup
source§fn clone(&self) -> ReplyKeyboardMarkup
fn clone(&self) -> ReplyKeyboardMarkup
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for ReplyKeyboardMarkup
impl Debug for ReplyKeyboardMarkup
source§impl Default for ReplyKeyboardMarkup
impl Default for ReplyKeyboardMarkup
source§fn default() -> ReplyKeyboardMarkup
fn default() -> ReplyKeyboardMarkup
source§impl<'de> Deserialize<'de> for ReplyKeyboardMarkup
impl<'de> Deserialize<'de> for ReplyKeyboardMarkup
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 From<BoxWrapper<Box<ReplyKeyboardMarkup>>> for ReplyKeyboardMarkup
impl From<BoxWrapper<Box<ReplyKeyboardMarkup>>> for ReplyKeyboardMarkup
source§fn from(t: BoxWrapper<Box<ReplyKeyboardMarkup>>) -> Self
fn from(t: BoxWrapper<Box<ReplyKeyboardMarkup>>) -> Self
source§impl From<BoxWrapper<Unbox<ReplyKeyboardMarkup>>> for ReplyKeyboardMarkup
impl From<BoxWrapper<Unbox<ReplyKeyboardMarkup>>> for ReplyKeyboardMarkup
source§fn from(t: BoxWrapper<Unbox<ReplyKeyboardMarkup>>) -> Self
fn from(t: BoxWrapper<Unbox<ReplyKeyboardMarkup>>) -> Self
source§impl From<NoSkipReplyKeyboardMarkup> for ReplyKeyboardMarkup
impl From<NoSkipReplyKeyboardMarkup> for ReplyKeyboardMarkup
source§fn from(t: NoSkipReplyKeyboardMarkup) -> Self
fn from(t: NoSkipReplyKeyboardMarkup) -> Self
source§impl Hash for ReplyKeyboardMarkup
impl Hash for ReplyKeyboardMarkup
source§impl Into<NoSkipReplyKeyboardMarkup> for ReplyKeyboardMarkup
impl Into<NoSkipReplyKeyboardMarkup> for ReplyKeyboardMarkup
source§fn into(self) -> NoSkipReplyKeyboardMarkup
fn into(self) -> NoSkipReplyKeyboardMarkup
source§impl Ord for ReplyKeyboardMarkup
impl Ord for ReplyKeyboardMarkup
source§fn cmp(&self, other: &ReplyKeyboardMarkup) -> Ordering
fn cmp(&self, other: &ReplyKeyboardMarkup) -> Ordering
1.21.0 · source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
source§impl PartialEq for ReplyKeyboardMarkup
impl PartialEq for ReplyKeyboardMarkup
source§fn eq(&self, other: &ReplyKeyboardMarkup) -> bool
fn eq(&self, other: &ReplyKeyboardMarkup) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for ReplyKeyboardMarkup
impl PartialOrd for ReplyKeyboardMarkup
source§fn partial_cmp(&self, other: &ReplyKeyboardMarkup) -> Option<Ordering>
fn partial_cmp(&self, other: &ReplyKeyboardMarkup) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for ReplyKeyboardMarkup
impl Serialize for ReplyKeyboardMarkup
impl Eq for ReplyKeyboardMarkup
impl StructuralPartialEq for ReplyKeyboardMarkup
Auto Trait Implementations§
impl Freeze for ReplyKeyboardMarkup
impl RefUnwindSafe for ReplyKeyboardMarkup
impl Send for ReplyKeyboardMarkup
impl Sync for ReplyKeyboardMarkup
impl Unpin for ReplyKeyboardMarkup
impl UnwindSafe for ReplyKeyboardMarkup
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§default unsafe fn clone_to_uninit(&self, dst: *mut T)
default unsafe fn clone_to_uninit(&self, dst: *mut T)
clone_to_uninit
)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.