Function grammers_client::types::reply_markup::inline
source · pub fn inline<B: Into<Vec<Vec<Inline>>>>(buttons: B) -> Inline
Expand description
Define inline buttons for a message.
These will display right under the message.
You cannot add images to the buttons, but you can use emoji (simply copy-paste them into your code, or use the correct escape sequence, or using any other input methods you like).
You will need to provide a matrix of button::Inline
, that is, a vector that contains the
rows from top to bottom, where the rows consist of a vector of buttons from left to right.
See the button
module to learn what buttons are available.
§Examples
use grammers_client::{InputMessage, reply_markup, button};
let artist = "Krewella";
client.send_message(chat, InputMessage::text("Select song").reply_markup(&reply_markup::keyboard(vec![
vec![button::text(format!("Song by {}", artist))],
vec![button::text("Previous"), button::text("Next")],
]))).await?;