Node.js中Facebook聊天机器人中的共享按钮 [英] Share button in Facebook chatbot in Node.js

查看:106
本文介绍了Node.js中Facebook聊天机器人中的共享按钮的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在我的聊天机器人中实现共享按钮.单击共享按钮后,该消息将与选定的联系人列表共享.图片FB_ChatBot.png是我试图在我的聊天机器人和Share_Btn_Output中实现的

I want to implement share button inside my chatbot. On click of share button the message will get shared with selected contact list. Image FB_ChatBot.png is what I am trying to implement inside my chatbot and Share_Btn_Output

此png是通过单击共享按钮产生的.

This png is output produced by share button clicked.

推荐答案

这是一个较晚的更新,但可以节省一些有用的时间.借助以下代码,您可以在facebook chatbot上显示多个按钮.用于开发的技术是node js,botbuilder,luis.

It's an late update but will save someone usefull time. With help of below code you can show multiple buttons on facebook chatbot. Technology used for development is node js,botbuilder,luis.

var msg = new builder.Message(session);
            msg.sourceEvent({
                "facebook": {
                    "attachment": {
                        "type": "template",
                        "payload": {
                            "template_type": "button",
                            "text": "You can either hit 'FAQ' to get the help, or head to the Mannual Help for getting help.",
                            "buttons": [
                                {
                                    "type": "web_url",
                                    "url": 'https://stackoverflow.com/',
                                    "title": "Mannual Help"
                                },
                                {
                                    "type": "postback",
                                    "title": "FAQ",
                                    "payload": "FAQ_SELECTED_BY_USER"
                                }]
                        }
                    }
                }
            });
            session.send(msg);

这篇关于Node.js中Facebook聊天机器人中的共享按钮的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆