pub struct ReplyKeyboardMarkup { /* private fields */ }
Expand description
Represents a custom keyboard with reply options.
Implementations§
Source§impl ReplyKeyboardMarkup
impl ReplyKeyboardMarkup
Sourcepub fn add_row<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = KeyboardButton>,
pub fn add_row<T>(self, value: T) -> Selfwhere
T: IntoIterator<Item = KeyboardButton>,
Sourcepub fn with_input_field_placeholder<T>(self, value: T) -> Self
pub fn with_input_field_placeholder<T>(self, value: T) -> Self
Sets a new input field placeholder.
§Arguments
value
- The placeholder to be shown in the input field when the keyboard is active; 1-64 characters.
Sourcepub fn with_one_time_keyboard(self, value: bool) -> Self
pub fn with_one_time_keyboard(self, value: bool) -> Self
Sets a new value for the one_time_keyboard
flag.
§Arguments
value
- Indicates whether to request clients to hide the keyboard as soon as it’s been used; default - false.
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.
Sourcepub fn with_is_persistent(self, value: bool) -> Self
pub fn with_is_persistent(self, value: bool) -> Self
Sets a new value for the is_persistent
flag.
§Arguments
value
- Indicates whether to request 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 with_resize_keyboard(self, value: bool) -> Self
pub fn with_resize_keyboard(self, value: bool) -> Self
Sets a new value for the resize_keyboard
flag.
§Arguments
value
- Indicates whether to request 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 with_selective(self, value: bool) -> Self
pub fn with_selective(self, value: bool) -> Self
Sets a new value for the selective
flag.
§Arguments
value
- Indicates whether to show the keyboard to specific users only.
Targets:
- users that are @mentioned in the text of the
crate::types::Message
object. - if the bot message is a reply (has
reply_to_message_id
), 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 more