ReplyKeyboardMarkup: Create a keyboard markup

View source: R/replymarkup.R

ReplyKeyboardMarkupR Documentation

Create a keyboard markup

Description

This object represents a custom keyboard with reply options.

Usage

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

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

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