botframework-sdk icon indicating copy to clipboard operation
botframework-sdk copied to clipboard

[Question] Button in botbuilder

Open chetanmekha opened this issue 9 years ago • 5 comments

@dandriscoll Hello Team, I want to show only buttons on FB messenger. How can I achieve this? Please check image for more details. button

In image there is button available called "Book An Appointment". How can we implement it?

chetanmekha avatar May 25 '17 12:05 chetanmekha

@chetanmekha Are you using .NET or Node SDK?

nwhitmont avatar May 25 '17 16:05 nwhitmont

Node SDK.. botbuilder npm version 3.8.3.

chetanmekha avatar May 26 '17 05:05 chetanmekha

@nwhitmont Please help me out over this? or guide me how can i implement it?

chetanmekha avatar May 29 '17 14:05 chetanmekha

Your best bet may be just using a HeroCard with a single button

meganlcooper avatar Jun 13 '17 14:06 meganlcooper

@meganlcooper I achieved it using below code, It will save someones valuable time.

`var msg = new builder.Message(session);
        msg.sourceEvent({
            "facebook": {
                "attachment": {
                    "type": "template",
                    "payload": {
                        "template_type": "button",
                        "text": "What do you want to do next?",
                        "buttons": [
                            {
                                "type": "web_url",
                                "url": "Image url",
                                "title": "Show Website"
                            },
                            {
                                "type": "postback",
                                "title": "Start Chatting",
                                "payload": "USER_DEFINED_PAYLOAD"
                            }]                               
                    }
                }
            }
        });
        session.send(msg);`

chetanmekha avatar Jun 16 '17 13:06 chetanmekha