#[non_exhaustive]pub struct InlineKeyboardButton {Show 13 fields
pub text: String,
pub url: Option<String>,
pub login_url: Option<LoginUrl>,
pub callback_data: Option<String>,
pub web_app: Option<WebAppInfo>,
pub switch_inline_query: Option<String>,
pub switch_inline_query_current_chat: Option<String>,
pub switch_inline_query_chosen_chat: Option<SwitchInlineQueryChosenChat>,
pub copy_text: Option<CopyTextButton>,
pub callback_game: Option<CallbackGame>,
pub pay: Option<bool>,
pub style: Option<String>,
pub icon_custom_emoji_id: Option<String>,
}Expand description
One button of an inline keyboard.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.text: StringLabel text on the button.
url: Option<String>HTTP or tg:// url to be opened when the button is pressed.
login_url: Option<LoginUrl>An HTTPS URL used to automatically authorize the user via the Login Widget.
callback_data: Option<String>Data to be sent in a callback query to the bot when the button is pressed, 1-64 bytes.
web_app: Option<WebAppInfo>Description of the Web App that will be launched when the user presses the button.
switch_inline_query: Option<String>Pressing the button will prompt the user to select one of their chats and send inline query.
switch_inline_query_current_chat: Option<String>Pressing the button will insert the bot’s username and inline query in the current chat.
switch_inline_query_chosen_chat: Option<SwitchInlineQueryChosenChat>Pressing the button will prompt the user to select one of their chats of the specified type.
copy_text: Option<CopyTextButton>Description of the button that copies the specified text to the clipboard.
callback_game: Option<CallbackGame>Description of the game that will be launched when the user presses the button.
pay: Option<bool>Specify true to send a Pay button. Must be the first button in the first row.
style: Option<String>Optional style of the button (e.g. color or shape).
icon_custom_emoji_id: Option<String>Custom emoji identifier for the button icon.
Implementations§
Source§impl InlineKeyboardButton
impl InlineKeyboardButton
Sourcepub fn callback(
text: impl Into<String>,
callback_data: impl Into<String>,
) -> InlineKeyboardButton
pub fn callback( text: impl Into<String>, callback_data: impl Into<String>, ) -> InlineKeyboardButton
Create a button that sends callback data when pressed.
This is the most common button type for interactive inline keyboards.
Sourcepub fn url(
text: impl Into<String>,
url: impl Into<String>,
) -> InlineKeyboardButton
pub fn url( text: impl Into<String>, url: impl Into<String>, ) -> InlineKeyboardButton
Create a button that opens a URL when pressed.
Sourcepub fn switch_inline_query(
text: impl Into<String>,
query: impl Into<String>,
) -> InlineKeyboardButton
pub fn switch_inline_query( text: impl Into<String>, query: impl Into<String>, ) -> InlineKeyboardButton
Create a button that switches to inline query mode in any chat.
Sourcepub fn switch_inline_query_current_chat(
text: impl Into<String>,
query: impl Into<String>,
) -> InlineKeyboardButton
pub fn switch_inline_query_current_chat( text: impl Into<String>, query: impl Into<String>, ) -> InlineKeyboardButton
Create a button that switches to inline query mode in the current chat.
Sourcepub fn web_app(
text: impl Into<String>,
web_app_url: impl Into<String>,
) -> InlineKeyboardButton
pub fn web_app( text: impl Into<String>, web_app_url: impl Into<String>, ) -> InlineKeyboardButton
Create a button that opens a Web App when pressed.
Sourcepub fn pay(text: impl Into<String>) -> InlineKeyboardButton
pub fn pay(text: impl Into<String>) -> InlineKeyboardButton
Create a Pay button. Must always be the first button in the first row.
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