InlineKeyboardMarkup: Create an inline keyboard markup

Description Usage Arguments Details Examples

View source: R/replymarkup.R

Description

This object represents an inline keyboard that appears right next to the message it belongs to.

Usage

1
InlineKeyboardMarkup(inline_keyboard)

Arguments

inline_keyboard

List of button rows, each represented by a list of InlineKeyboardButton objects.

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

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
## Not run: 
# Initialize bot
bot <- Bot(token = "TOKEN")
chat_id <- "CHAT_ID"

# Create Inline Keyboard
text <- "Could you type their phone number, please?"
IKM <- InlineKeyboardMarkup(
  inline_keyboard = list(
    list(InlineKeyboardButton(1),
         InlineKeyboardButton(2),
         InlineKeyboardButton(3)),
    list(InlineKeyboardButton(4),
         InlineKeyboardButton(5),
         InlineKeyboardButton(6)),
    list(InlineKeyboardButton(7),
         InlineKeyboardButton(8),
         InlineKeyboardButton(9)),
    list(InlineKeyboardButton("*"),
         InlineKeyboardButton(0),
         InlineKeyboardButton("#"))
    )
  )

# Send Inline Keyboard
bot$sendMessage(chat_id, text, reply_markup = IKM)

## End(Not run)

ebeneditos/telegram.bot documentation built on Dec. 2, 2018, 1:18 p.m.