Facebook List template and addImage
mtezzele opened this issue · comments
Marco Tezzele commented
When I use the List template of the facebook bot it seems that addImage is required for the first bubble. Just doing a copy/paste of your example and removing the first addImage should reproduce the problem:
const botBuilder = require('claudia-bot-builder');
const fbTemplate = botBuilder.fbTemplate;
module.exports = botBuilder(message => {
if (message.type === 'facebook') {
const list = new fbTemplate.List();
return list
.addBubble('Claudia.js', 'Deploy Node.js microservices to AWS easily')
.addDefaultAction('https://github.com/claudiajs/claudia-bot-builder')
.addButton('Say hello', 'HELLO')
.addBubble('Claudia Bot Builder')
.addImage('https://claudiajs.com/assets/claudia-bot-builder-video.jpg')
.addButton('Go to Github', 'https://github.com/claudiajs/claudia-bot-builder')
.addListButton('Contact us if you like it', 'https://claudiajs.com')
.get();
}
});
Andrew Yip commented
list top_element_style defaults to "large", you can set it to "compact" by passing it to new fbTemplate.List("compact")
Marco Tezzele commented
Thank you very much @yipcma! This solves the problem.
Slobodan Stojanović commented