Enum teloxide::types::InlineKeyboardButtonKind
source · 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§
source§impl Clone for InlineKeyboardButtonKind
impl Clone for InlineKeyboardButtonKind
source§fn clone(&self) -> InlineKeyboardButtonKind
fn clone(&self) -> InlineKeyboardButtonKind
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moresource§impl Debug for InlineKeyboardButtonKind
impl Debug for InlineKeyboardButtonKind
source§impl<'de> Deserialize<'de> for InlineKeyboardButtonKind
impl<'de> Deserialize<'de> for InlineKeyboardButtonKind
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineKeyboardButtonKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<InlineKeyboardButtonKind, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
source§impl Hash for InlineKeyboardButtonKind
impl Hash for InlineKeyboardButtonKind
source§impl PartialEq<InlineKeyboardButtonKind> for InlineKeyboardButtonKind
impl PartialEq<InlineKeyboardButtonKind> for InlineKeyboardButtonKind
source§fn eq(&self, other: &InlineKeyboardButtonKind) -> bool
fn eq(&self, other: &InlineKeyboardButtonKind) -> bool
self
and other
values to be equal, and is used
by ==
.source§impl Serialize for InlineKeyboardButtonKind
impl Serialize for InlineKeyboardButtonKind
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
impl Eq for InlineKeyboardButtonKind
impl StructuralEq for InlineKeyboardButtonKind
impl StructuralPartialEq for InlineKeyboardButtonKind
Auto Trait Implementations§
impl RefUnwindSafe for InlineKeyboardButtonKind
impl Send for InlineKeyboardButtonKind
impl Sync for InlineKeyboardButtonKind
impl Unpin for InlineKeyboardButtonKind
impl UnwindSafe for InlineKeyboardButtonKind
Blanket Implementations§
source§impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key
and return true
if they are equal.