Charca / bootbot

Facebook Messenger Bot Framework for Node.js
MIT License
974 stars 253 forks source link

top_element_style = LARGE by default and can't see how to change this #146

Closed Dmdv closed 6 years ago

Dmdv commented 6 years ago
  chat.say({
    elements: [{
        title: 'USD',
        image_url: config.get('global_url') + 'blue.png',
        "buttons": [{
          "title": "Купить",
          "type": "web_url",
          "url": "https://www.ya.ru",
          "messenger_extensions": false,
          "webview_height_ratio": "tall"
        }],
        "default_action": {
          "type": "web_url",
          "url": "https://peterssendreceiveapp.ngrok.io/view?item=100",
          "messenger_extensions": false,
          "webview_height_ratio": "tall"
        }
      },
      {
        title: 'EURO',
        image_url: config.get('global_url') + 'usd.jpeg',
        "buttons": [{
          "title": "Купить",
          "type": "web_url",
          "url": "https://www.ya.ru",
          "messenger_extensions": false,
          "webview_height_ratio": "tall"
        }],
        "default_action": {
          "type": "web_url",
          "url": "https://peterssendreceiveapp.ngrok.io/view?item=100",
          "messenger_extensions": false,
          "webview_height_ratio": "tall"
        }
      }
    ],
    buttons: [{
      type: 'postback',
      title: 'View More',
      payload: 'VIEW_MORE'
    }]
  });

Is it possible to pass top_element_style = compact ?

mraaroncruz commented 6 years ago

@Dmdv did you look at the docs and try to copy the structure they ask for there? Most of these things that don't have a nice wrapper "Just Work" if you create the correct structure in chat.say() like above. Did you try it out yet?

Dmdv commented 6 years ago

@mraaroncruz Sure, I've run through all the docs and found solution looking at source code passing option parameter just works

{
    topElementStyle: "compact"
}