Struct botapi::gen_types::InlineKeyboardButton
source · pub struct InlineKeyboardButton { /* private fields */ }Expand description
This object represents one button of an inline keyboard. You must use exactly one of the optional fields.
Implementations§
source§impl InlineKeyboardButton
impl InlineKeyboardButton
pub fn noskip(self) -> NoSkipInlineKeyboardButton
source§impl InlineKeyboardButton
impl InlineKeyboardButton
pub fn new(text: String) -> Self
sourcepub fn into_tuple(
self
) -> (String, Option<String>, Option<String>, Option<WebAppInfo>, Option<LoginUrl>, Option<String>, Option<String>, Option<SwitchInlineQueryChosenChat>, Option<CallbackGame>, Option<bool>)
pub fn into_tuple( self ) -> (String, Option<String>, Option<String>, Option<WebAppInfo>, Option<LoginUrl>, Option<String>, Option<String>, Option<SwitchInlineQueryChosenChat>, Option<CallbackGame>, Option<bool>)
Consumes and deconstructs this type into a tuple with one element per field. Tuple type returned is: (text, url, callback_data, web_app, login_url, switch_inline_query, switch_inline_query_current_chat, switch_inline_query_chosen_chat, callback_game, pay)
sourcepub fn get_text_ref<'a>(&'a self) -> &'a str
pub fn get_text_ref<'a>(&'a self) -> &'a str
Label text on the button
sourcepub fn set_text<'a>(&'a mut self, text: String) -> &'a mut Self
pub fn set_text<'a>(&'a mut self, text: String) -> &'a mut Self
Label text on the button
sourcepub fn get_url<'a>(&'a self) -> Option<Cow<'a, str>>
pub fn get_url<'a>(&'a self) -> Option<Cow<'a, str>>
Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
sourcepub fn get_url_ref<'a>(&'a self) -> Option<&'a str>
pub fn get_url_ref<'a>(&'a self) -> Option<&'a str>
Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
sourcepub fn set_url<'a>(&'a mut self, url: Option<String>) -> &'a mut Self
pub fn set_url<'a>(&'a mut self, url: Option<String>) -> &'a mut Self
Optional. HTTP or tg:// URL to be opened when the button is pressed. Links tg://user?id=<user_id> can be used to mention a user by their ID without using a username, if this is allowed by their privacy settings.
sourcepub fn get_callback_data<'a>(&'a self) -> Option<Cow<'a, str>>
pub fn get_callback_data<'a>(&'a self) -> Option<Cow<'a, str>>
Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
sourcepub fn get_callback_data_ref<'a>(&'a self) -> Option<&'a str>
pub fn get_callback_data_ref<'a>(&'a self) -> Option<&'a str>
Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
sourcepub fn set_callback_data<'a>(
&'a mut self,
callback_data: Option<String>
) -> &'a mut Self
pub fn set_callback_data<'a>( &'a mut self, callback_data: Option<String> ) -> &'a mut Self
Optional. Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes
sourcepub fn get_web_app<'a>(&'a self) -> Option<Cow<'a, WebAppInfo>>
pub fn get_web_app<'a>(&'a self) -> Option<Cow<'a, WebAppInfo>>
Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
sourcepub fn get_web_app_ref<'a>(&'a self) -> Option<&'a WebAppInfo>
pub fn get_web_app_ref<'a>(&'a self) -> Option<&'a WebAppInfo>
Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
sourcepub fn set_web_app<'a>(
&'a mut self,
web_app: Option<WebAppInfo>
) -> &'a mut Self
pub fn set_web_app<'a>( &'a mut self, web_app: Option<WebAppInfo> ) -> &'a mut Self
Optional. Description of the Web App that will be launched when the user presses the button. The Web App will be able to send an arbitrary message on behalf of the user using the method answerWebAppQuery. Available only in private chats between a user and the bot.
sourcepub fn get_login_url<'a>(&'a self) -> Option<Cow<'a, LoginUrl>>
pub fn get_login_url<'a>(&'a self) -> Option<Cow<'a, LoginUrl>>
Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
sourcepub fn get_login_url_ref<'a>(&'a self) -> Option<&'a LoginUrl>
pub fn get_login_url_ref<'a>(&'a self) -> Option<&'a LoginUrl>
Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
sourcepub fn set_login_url<'a>(
&'a mut self,
login_url: Option<LoginUrl>
) -> &'a mut Self
pub fn set_login_url<'a>( &'a mut self, login_url: Option<LoginUrl> ) -> &'a mut Self
Optional. An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.
sourcepub fn get_switch_inline_query<'a>(&'a self) -> Option<Cow<'a, str>>
pub fn get_switch_inline_query<'a>(&'a self) -> Option<Cow<'a, str>>
Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. May be empty, in which case just the bot’s username will be inserted.
sourcepub fn get_switch_inline_query_ref<'a>(&'a self) -> Option<&'a str>
pub fn get_switch_inline_query_ref<'a>(&'a self) -> Option<&'a str>
Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. May be empty, in which case just the bot’s username will be inserted.
sourcepub fn set_switch_inline_query<'a>(
&'a mut self,
switch_inline_query: Option<String>
) -> &'a mut Self
pub fn set_switch_inline_query<'a>( &'a mut self, switch_inline_query: Option<String> ) -> &'a mut Self
Optional. If set, pressing the button will prompt the user to select one of their chats, open that chat and insert the bot’s username and the specified inline query in the input field. May be empty, in which case just the bot’s username will be inserted.
sourcepub fn get_switch_inline_query_current_chat<'a>(
&'a self
) -> Option<Cow<'a, str>>
pub fn get_switch_inline_query_current_chat<'a>( &'a self ) -> Option<Cow<'a, str>>
Optional. If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. May be empty, in which case only the bot’s username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.
sourcepub fn get_switch_inline_query_current_chat_ref<'a>(&'a self) -> Option<&'a str>
pub fn get_switch_inline_query_current_chat_ref<'a>(&'a self) -> Option<&'a str>
Optional. If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. May be empty, in which case only the bot’s username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.
sourcepub fn set_switch_inline_query_current_chat<'a>(
&'a mut self,
switch_inline_query_current_chat: Option<String>
) -> &'a mut Self
pub fn set_switch_inline_query_current_chat<'a>( &'a mut self, switch_inline_query_current_chat: Option<String> ) -> &'a mut Self
Optional. If set, pressing the button will insert the bot’s username and the specified inline query in the current chat’s input field. May be empty, in which case only the bot’s username will be inserted. This offers a quick way for the user to open your bot in inline mode in the same chat - good for selecting something from multiple options.
sourcepub fn get_switch_inline_query_chosen_chat<'a>(
&'a self
) -> Option<Cow<'a, SwitchInlineQueryChosenChat>>
pub fn get_switch_inline_query_chosen_chat<'a>( &'a self ) -> Option<Cow<'a, SwitchInlineQueryChosenChat>>
Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot’s username and the specified inline query in the input field
sourcepub fn get_switch_inline_query_chosen_chat_ref<'a>(
&'a self
) -> Option<&'a SwitchInlineQueryChosenChat>
pub fn get_switch_inline_query_chosen_chat_ref<'a>( &'a self ) -> Option<&'a SwitchInlineQueryChosenChat>
Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot’s username and the specified inline query in the input field
sourcepub fn set_switch_inline_query_chosen_chat<'a>(
&'a mut self,
switch_inline_query_chosen_chat: Option<SwitchInlineQueryChosenChat>
) -> &'a mut Self
pub fn set_switch_inline_query_chosen_chat<'a>( &'a mut self, switch_inline_query_chosen_chat: Option<SwitchInlineQueryChosenChat> ) -> &'a mut Self
Optional. If set, pressing the button will prompt the user to select one of their chats of the specified type, open that chat and insert the bot’s username and the specified inline query in the input field
sourcepub fn get_callback_game<'a>(&'a self) -> Option<Cow<'a, CallbackGame>>
pub fn get_callback_game<'a>(&'a self) -> Option<Cow<'a, CallbackGame>>
Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row.
sourcepub fn get_callback_game_ref<'a>(&'a self) -> Option<&'a CallbackGame>
pub fn get_callback_game_ref<'a>(&'a self) -> Option<&'a CallbackGame>
Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row.
sourcepub fn set_callback_game<'a>(
&'a mut self,
callback_game: Option<CallbackGame>
) -> &'a mut Self
pub fn set_callback_game<'a>( &'a mut self, callback_game: Option<CallbackGame> ) -> &'a mut Self
Optional. Description of the game that will be launched when the user presses the button. NOTE: This type of button must always be the first button in the first row.
sourcepub fn get_pay<'a>(&'a self) -> Option<bool>
pub fn get_pay<'a>(&'a self) -> Option<bool>
Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
sourcepub fn get_pay_ref<'a>(&'a self) -> Option<bool>
pub fn get_pay_ref<'a>(&'a self) -> Option<bool>
Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
sourcepub fn set_pay<'a>(&'a mut self, pay: Option<bool>) -> &'a mut Self
pub fn set_pay<'a>(&'a mut self, pay: Option<bool>) -> &'a mut Self
Optional. Specify True, to send a Pay button. NOTE: This type of button must always be the first button in the first row and can only be used in invoice messages.
Trait Implementations§
source§impl Clone for InlineKeyboardButton
impl Clone for InlineKeyboardButton
source§fn clone(&self) -> InlineKeyboardButton
fn clone(&self) -> InlineKeyboardButton
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more