pub enum InlineKeyboardButtonKind {
    Url(Url),
    LoginUrl(LoginUrl),
    CallbackData(String),
    WebApp(WebAppInfo),
    SwitchInlineQuery(String),
    SwitchInlineQueryCurrentChat(String),
    CallbackGame(CallbackGame),
    Pay(True),
}

Variants§

§

Url(Url)

HTTP or tg:// url to be opened when button is pressed.

Links in the form of 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. This will only work in Telegram versions released after December 7, 2021. Older clients will display unsupported message.

§

LoginUrl(LoginUrl)

An HTTPS URL used to automatically authorize the user. Can be used as a replacement for the Telegram Login Widget.

§

CallbackData(String)

Data to be sent in a CallbackQuery to the bot when button is pressed, 1-64 bytes.

§

WebApp(WebAppInfo)

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.

§

SwitchInlineQuery(String)

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. Can be empty, in which case just the bot’s username will be inserted.

Note: This offers an easy way for users to start using your bot in inline mode when they are currently in a private chat with it. Especially useful when combined with switch_pm… actions – in this case the user will be automatically returned to the chat they switched from, skipping the chat selection screen.

§

SwitchInlineQueryCurrentChat(String)

If set, pressing the button will insert the bot‘s username and the specified inline query in the current chat’s input field. Can 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.

§

CallbackGame(CallbackGame)

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.

§

Pay(True)

Specify True, to send a Pay button.

Note

This type of button must always be the first button in the first row.

Trait Implementations§

Returns a copy of the value. Read more
Performs copy-assignment from source. Read more
Formats the value using the given formatter. Read more
Deserialize this value from the given Serde deserializer. Read more
Feeds this value into the given Hasher. Read more
Feeds a slice of this type into the given Hasher. Read more
This method tests for self and other values to be equal, and is used by ==.
This method tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more
Compare self to key and return true if they are equal.
Unerase this erased pointer. Read more
Available on non-enforce_1_1_0_semantics only.
Whether this implementor has acknowledged the 1.1.0 update to unerase’s documented implementation requirements. Read more
Turn this erasable pointer into an erased pointer. Read more

Returns the argument unchanged.

Converts to this type from a reference to the input type.
Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Instruments this type with the current Span, returning an Instrumented wrapper. Read more

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The resulting type after obtaining ownership.
Creates owned data from borrowed data, usually by cloning. Read more
Uses borrowed data to replace owned data, usually by cloning. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.
Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more