claudiajs / claudia-bot-builder

Create chat bots for Facebook Messenger, Slack, Amazon Alexa, Skype, Telegram, Viber, Line, GroupMe, Kik and Twilio and deploy to AWS Lambda in minutes

Home Page:https://claudiajs.com/claudia-bot-builder.html

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Facebook List template and addImage

mtezzele opened this issue · comments

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();
  }
});

list top_element_style defaults to "large", you can set it to "compact" by passing it to new fbTemplate.List("compact")

Thank you very much @yipcma! This solves the problem.

Thanks @yipcma.
I am closing the issue.
@mtezzele use Gitter for any additional questions.