class
Buttons
Source: structures/
Message type buttons
Method
new Buttons(body, buttons, title, footer)
Parameters
Name | Type | Optional | Description |
---|---|---|---|
body |
|
|
|
buttons |
|
|
See |
title |
|
|
Value can be null. |
footer |
|
|
Value can be null. |
Properties
body (string or MessageMedia)
Message body
buttons Array of FormattedButtonSpec
buttons of message
footer string
footer of message
title string
title of message
Method
_format(buttons) → Array of FormattedButtonSpec
Creates button array from simple array
Example
Input: [{id:'customId',body:'button1'},{body:'button2'},{body:'button3'},{body:'button4'}]
Returns: [{ buttonId:'customId',buttonText:{'displayText':'button1'},type: 1 },{buttonId:'n3XKsL',buttonText:{'displayText':'button2'},type:1},{buttonId:'NDJk0a',buttonText:{'displayText':'button3'},type:1}]
Parameter
Name | Type | Optional | Description |
---|---|---|---|
buttons |
Array of ButtonSpec |
|
- Returns
-
Array of FormattedButtonSpec