fbbotw.post_persistent_menu

fbbotw.post_persistent_menu(persistent_menu)[source]

Sets persistent menus on the messenger chat view.

Usage:
>>> # Define you persistent menu dict
>>> # See the fb docs for better reference on building it
>>> persistent_menu =  [
        {
            "composer_input_disabled": False,
            "locale": "default",
            "call_to_actions": [
                {
                    "type": "nested",
                    "title": "First Option",
                    "call_to_actions": [
                        {
                            "type": "postback",
                            "title": "First Option of First Option",
                            "payload": "YOUR_PAYLOAD"
                        },
                },
                {
                    "type": "postback",
                    "title": "Second Option",
                    "payload": "YOUR_PAYLOAD4"
                },
            ]
        }
    ]
>>> # Set the menu calling the api
>>> response = fbbotw.post_persistent_menu(
        persistent_menu=persistent_menu
    )
Parameters:

persistent_menu (list) –

format:

>>> persistent_menu =  [
        {
            “composer_input_disabled”: False,
            “locale”: “default”,
            “call_to_actions”: [
                {
                    “type”: “nested”,
                    “title”: “First Option”,
                    “call_to_actions”: [
                        {
                            “type”: “postback”,
                            “title”: “First Option of First Option”,
                            “payload”: “YOUR_PAYLOAD”
                        },
                        {
                            “type”: “nested”,
                            “title”: “Second Option of First Option”,
                            “call_to_actions”: [
                                {
                                    “type”: “postback”,
                                    “title”: “ABC”,
                                    “payload”: “YOUR_PAYLOAD2”
                                },
                                {
                                    “type”: “postback”,
                                    “title”: “CDE”,
                                    “payload”: “YOUR_PAYLOAD3”
                                }
                            ]
                        },
                    ]
                },
                {
                    “type”: “postback”,
                    “title”: “Second Option”,
                    “payload”: “YOUR_PAYLOAD4”
                },
            ]
        }
    ]

Returns:

Response object

Facebook docs:

/persistent-menu