Botkit: Quick replies inside conversation? (facebook)

Created on 12 Dec 2016  路  6Comments  路  Source: howdyai/botkit

Hello, I was wondering if it were possible to ask the user a question using convo.ask and present them with a list of quick reply options? I can see that quick replies can be done using the bot.reply functionality however I'm not sure how to work that into a conversation scenario.

Facebook-related question

Most helpful comment

Fantastic, thanks for the _quick replies_. 馃榿

For anyone wanting to see code I got it working like this:

convo.ask({
  text: 'How old are you?',
  quick_replies: [{
    content_type: 'text',
    title: 'Child',
    payload: '< 13',
  }, {
    content_type: 'text',
    title: 'Teenager',
    payload: '13 - 19',
  }, {
    content_type: 'text',
    title: 'Adult',
    payload: '> 19',
  }],
}, function(response, convo) {
  convo.next();
});

All 6 comments

Refer to issue #508 and #543 you will probably find what you need there

Yes, you can include quick replies in the convo.ask function.

Fantastic, thanks for the _quick replies_. 馃榿

For anyone wanting to see code I got it working like this:

convo.ask({
  text: 'How old are you?',
  quick_replies: [{
    content_type: 'text',
    title: 'Child',
    payload: '< 13',
  }, {
    content_type: 'text',
    title: 'Teenager',
    payload: '13 - 19',
  }, {
    content_type: 'text',
    title: 'Adult',
    payload: '> 19',
  }],
}, function(response, convo) {
  convo.next();
});

@nicgordon quick reply is not working well in botkit we have been trying to use in conversation and bot.reply. The problem is not with it being send but the event(webhook) that it triggers. Facebook says you will get it by post_back in botkit members example they use the title in patterns.

I am confuse and at the end all of it is not trigger any webhook. I've tried with post_back(doesn't work) and pattern(sometimes work and sometimes no).


convo.ask({
                        "text": "Choose man ",
                        "quick_replies": [
                            {
                                "content_type": "text",
                                "title": "Papy",
                                "payload": "PAPY_REPLY"
                            },
                            {
                                "content_type": "text",
                                "title": "Service Provider",
                                "payload": "KAKE_REPLY"
                            }
                        ]
                    }, [{
                        pattern: "Papy", callback: function (response, convo) {
                            convo.say("good")}},{pattern:"Kake",callback: function (response, convo) {
                            convo.say("Fine")}}]);


convo.next();

@MagSag can you open a fresh issue as a bug, and we will take a look?

how to send quick reply using bot.say()??
ref https://botkit.ai/docs/core.html#botsay

Was this page helpful?
0 / 5 - 0 ratings