Menu Handler
The menu handler is used to display dynamic buttons in the unfurled card. This handler will be triggered when the menu option is clicked. With this handler, you can construct and return dynamic buttons for the unfurl card.
You will get the following attributes when the menu handler is executed:
Attribute | Description |
domain | Domain which matches the one handled by the extension |
url | Link sent by the user |
chat | Details of the chat where the link where the link was entered or sent |
user | Detals of the user who entered or sent the link |
Note: You can return a maximum of 5 buttons as an array for the response.
Attributes for each buttons
Attribute | Type | Description |
type* | String | The type of action. Allowed value: button |
label* | String | Button label. (max length: 100) |
hint | String | Button hint. (max length: 250) |
style | String | To denote the style(positive/negative) of the button. Allowed values: + | - |
confirm | JSON Object | Properties of the confirmation dialog box before the action is executed. It can be included based on the requirement. |
params | JSON Object | Dynamic key value pair for reference. A maximum of 10 keys with 100 character value can be passed. |
Sample code
return [
{
"type": "button",
"label": "Share",
"hint": "Share page to chat participants",
"params": {
"page_id": "demopageid123"
}
}
];