ReplyKeyboardMarkup: Create a keyboard markup

Description Usage Arguments Examples

View source: R/replymarkup.R

Description

This object represents a custom keyboard with reply options.

Usage

1
2
ReplyKeyboardMarkup(keyboard, resize_keyboard = NULL,
  one_time_keyboard = NULL, selective = NULL)

Arguments

keyboard

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

resize_keyboard

(Optional). Requests clients to resize the keyboard vertically for optimal fit. Defaults to FALSE, in which case the custom keyboard is always of the same height as the app's standard keyboard.

one_time_keyboard

(Optional). Requests clients to hide the keyboard as soon as it's been used. The keyboard will still be available, but clients will automatically display the usual letter-keyboard in the chat - the user can press a special button in the input field to see the custom keyboard again. Defaults to FALSE.

selective

(Optional). Use this parameter if you want to show the keyboard to specific users only.

Examples

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

# Create Custom Keyboard
text <- "Aren't those custom keyboards cool?"
RKM <- ReplyKeyboardMarkup(
  keyboard = list(
    list(KeyboardButton("Yes, they certainly are!")),
    list(KeyboardButton("I'm not quite sure")),
    list(KeyboardButton('No...'))),
  resize_keyboard = FALSE,
  one_time_keyboard = TRUE
)

# Send Custom Keyboard
bot$sendMessage(chat_id, text, reply_markup = RKM)

## End(Not run)

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