Constructor
new Buttons(body, buttons, titlenullable, footernullable)
Parameters:
| Name | Type | Attributes | Description |
|---|---|---|---|
body |
string | MessageMedia | ||
buttons |
Array.<ButtonSpec> | See |
|
title |
string |
<nullable> |
|
footer |
string |
<nullable> |
- Source:
Members
body :string|MessageMedia
Message body
Type:
- string | MessageMedia
- Source:
buttons :Array.<FormattedButtonSpec>
buttons of message
Type:
- Array.<FormattedButtonSpec>
- Source:
footer :string
footer of message
Type:
- string
- Source:
title :string
title of message
Type:
- string
- Source:
Methods
_format(buttons) → {Array.<FormattedButtonSpec>}
Creates button array from simple array
Parameters:
| Name | Type | Description |
|---|---|---|
buttons |
Array.<ButtonSpec> |
- Source:
Returns:
- Type
- Array.<FormattedButtonSpec>
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}]