Persistent Menu
Brings users directly into the top-level features and flows in your Messenger bot.
A Get Started button is required to use persistent menu feature.
Facebook Messenger supports a hierarchical menu UI that allows users to start bot flows or open web links. There are three supported menu item types flow
, url
, nested
.
The persistent menu is configured from Bot > Integrations > Messenger.
YAML syntax
Due to the flexibility and the hierarchical nature of the menu, Meya uses a simple YAML syntax to define the persistent menu.
- text: My Account
type: nested
items:
- text: Pay Bill
type: flow
flow: pay_bill
- text: History
type: flow
flow: pay_bill
- text: Latest News
url: http://petershats.parseapp.com/hat-news
type: url
webview_height_ratio: full
Tip: Use template shortcuts
At the top of the menu editor are several buttons that when pressed will paste YAML templates in the editor.
Flow menu item
Use type: flow
to create a flow menu item. When pressed, a bot flow will start. See the full docs on start buttons.
Parameters
flow
- name of the flow to invokeaction
- (optional) action to invoke when presseddata
- (optional) dictionary data that will be passed toflow
scope datastore
URL menu item
Use type: url
to create a url menu item, that when clicked will open a webview to the url.
url
- URL to open in Messenger browserwebview_height_ratio
- (optional, default:full
) height of the Webview. Valid values includecompact
,tall
,full
.messenger_extensions
- (optional, default:false
) set totrue
to use Messenger Extensionsfallback_url
- (optional, default:url
) URL to use on clients that don't support Messenger Extensions
Nested menu item
Use type: nested
to create a nested menu item.
items
- list of nested menu items. Sub-items can be of typeflow
,url
,nested
Limits
text
is limited to 30 characters- You can have at most 3 hierarchical levels
- There can be at most 3 items at the top level, and 5 items on levels 2 and 3
Locales
You can create persistent menus that are customized automatically to your user's locale. If the locale does not match any of the persistent menus, the default persistent menu will be shown.
See the list of supported locales.
Disable composer input
Set to true
to disable user input in the menu. This means users will only be able to interact with your bot via the menu, buttons, and webviews. This can be useful for highly structured bots without any natural language understanding.
Persistent menu is required if disabling the composer input.
Updated over 6 years ago