在Microsoft Bot Framework中不使用watterfall发送快速回复

时间:2016-11-03 20:16:04

标签: node.js botframework

我正在使用microsoft bot框架,我想发送快速回复,但我不想使用watterfall,我希望它由luis处理,如何使用node sdk设置消息的快速回复?

1 个答案:

答案 0 :(得分:1)

以下是它的完成方式,您必须将其添加到源事件,我在此处找到https://github.com/Microsoft/BotBuilder-Samples/blob/master/Node/core-ChannelData/app.js#L92

 let message = new builder.Message(session)
            .text("Hello")
            .sourceEvent({
                facebook: {
                    "quick_replies": [
                        {
                            "content_type": "text",
                            "title": "Weather",
                            "payload": "Weather"
                        },
                        {
                            "content_type": "text",
                            "title": "Forecast",
                            "payload": "Forecast"
                        }
                    ]
                }
            })
session.send(message)