InlineKeyboardButton: Create an inline keyboard button

View source: R/replymarkup.R

InlineKeyboardButtonR Documentation

Create an inline keyboard button

Description

This object represents one button of an inline keyboard. You must use exactly one of the optional fields. If all optional fields are NULL, by defect it will generate callback_data with same data as in text.

Usage

InlineKeyboardButton(
  text,
  url = NULL,
  callback_data = NULL,
  switch_inline_query = NULL,
  switch_inline_query_current_chat = NULL
)

is.InlineKeyboardButton(x)

Arguments

text

Label text on the button.

url

(Optional). HTTP url to be opened when button is pressed.

callback_data

(Optional). Data to be sent in a callback query to the bot when button is pressed, 1-64 bytes.

switch_inline_query

(Optional). 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.

switch_inline_query_current_chat

(Optional). 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.

x

Object to be tested.

Details

Note: After the user presses a callback button, Telegram clients will display a progress bar until you call answerCallbackQuery. It is, therefore, necessary to react by calling answerCallbackQuery even if no notification to the user is needed (e.g., without specifying any of the optional parameters).


telegram.bot documentation built on Sept. 7, 2022, 5:07 p.m.