Skip to content

Keyboard node

Guidone edited this page Feb 15, 2018 · 4 revisions

Show quick alternatives (canned answers) to the users with custom persistent keyboards.

The keyboard automatically closes after the user clicks on a button, the keyboard is still available after use. To completely remove a keyboard use a Keyboard node with an empty buttons set.

The custom keyboards can also be passed through the payload by an upstream node Function node:

msg.payload = {
  message: 'The message with the buttons',
  buttons: [
    {type: 'keyboardButton', label: 'label of the button 1'},
    {type: 'newline'},
    {type: 'keyboardButton', label: 'another button'}
  ]
}
return msg;

Available parameters for the msg.payload

Name Type Description
message string The message text above the buttons
buttons array of [button] The list of inline buttons

The [button] object

Name Type Description
type string The type of the element, could be: newline (adds a new line of buttons) or keyboardButton
label string Label of the button

Telegram

Clone this wiki locally