Using Facebook utter in domain.yml

Hi team,

when using facebook without an custom action one can add the utter into domain.yml.

I found it working after digging into facebook.py like so:

utter_goodbye:

  - custom:
    elements:
      - title: 3333
        subtitle: "We have  qwqwwq *the* _right_ hat for everyone."
        default_action: 
            type: "web_url"
            url: "https://tithal.life"
            webview_height_ratio: "tall"
        buttons:
          - type: web_url
            url: "https://tithal.life"
            title: "View Website1"
          - type: web_url
            url: "https://tithal.life"
            title: "View Website2"

The problem is that facebook.py expects an iteratable object of buttons.

@staticmethod
def _add_postback_info(buttons: List[Dict[Text, Any]]) -> None:
    """Make sure every button has a type. Modifications happen in place."""
    for button in buttons:
        if 'type' not in button:
            button['type'] = "postback"

Throwing an error when buttons is null. Even empty object is not working.

I suggest to wrap the iterator into an if clause as buttons should be optional like in facebooks specs. Actually I do not need buttons in my case.

best

Timo

Hi @tschnoelzer, thanks for describing and debugging it! Could you please open a Github issue for it? If you want you can add a PR which fixes it. That would be a great help for us :tada:

Hi Tobias … Issue filed … 4712 … best Timo

Thanks @tschnoelzer!