Skip to content
This repository has been archived by the owner on Sep 20, 2024. It is now read-only.

Quick replies inside conversation? (facebook) #547

Closed
nicgordon opened this issue Dec 11, 2016 · 6 comments
Closed

Quick replies inside conversation? (facebook) #547

nicgordon opened this issue Dec 11, 2016 · 6 comments

Comments

@nicgordon
Copy link

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.

@PierreMarieRiviere
Copy link

PierreMarieRiviere commented Dec 12, 2016

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

@benbrown
Copy link
Contributor

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

@nicgordon
Copy link
Author

nicgordon commented Dec 13, 2016

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

@aidonsnous
Copy link

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

@peterswimm
Copy link
Contributor

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

@sherryt400
Copy link

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

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

6 participants