pub struct Button {
pub raw: KeyboardButton,
}Expand description
Inline button to be used as the reply markup underneath a message.
Fields§
§raw: KeyboardButtonImplementations§
Source§impl Button
impl Button
Sourcepub fn data<T: Into<String>, B: Into<Vec<u8>>>(text: T, bytes: B) -> Button
pub fn data<T: Into<String>, B: Into<Vec<u8>>>(text: T, bytes: B) -> Button
Creates a button that will trigger a crate::update::CallbackQuery when clicked.
Although any combination of bytes can be used (including null, and not just UTF-8), there is
a limit to how long the payload data
can be (see the description for the callback_data field for an up-to-date value). If you
need to store more data than that, consider storing the real data in some form of database,
and a reference to that data’s row in the button’s payload.
Both the text and bytes data must be non-empty.
Sourcepub fn switch<T: Into<String>, Q: Into<String>>(text: T, query: Q) -> Button
pub fn switch<T: Into<String>, Q: Into<String>>(text: T, query: Q) -> Button
Creates a button to force the user to switch to inline mode (perform inline queries).
Pressing the button will insert the bot’s username and the specified inline query in the input field.
Sourcepub fn switch_elsewhere<T: Into<String>, Q: Into<String>>(
text: T,
query: Q,
) -> Button
pub fn switch_elsewhere<T: Into<String>, Q: Into<String>>( text: T, query: Q, ) -> Button
Creates a button identical to Self::switch, except the user will be prompted to select a
different peer.
Pressing the button will prompt the user to select one of their peers, open that peer and insert the bot’s username and the specified inline query in the input field.