[英]How can i send Quick Replies to Facebook Through Dialogflow Fulfillment
I am trying to send Quick Replies to Facebook users through Dialogflow Fulfillment and I have not been able to achieve that I have tried a lot and have not succeeded Is there any help Codes i have tried:我正在尝试通过 Dialogflow Fulfillment 向 Facebook 用户发送快速回复,但我无法实现这一点,我已经尝试了很多但都没有成功是否有我尝试过的帮助代码:
#1: #1:
function QuickReplies(agent) {
agent.add(“Select one”);
agent.add(new Suggestion(“Quick Reply”));
agent.add(new Suggestion(“Suggestion”));
}
#2: #2:
function QuickReplies(agent)
{
const quickReplies1 = new Suggestion({
title: "What do you want to do?",
reply: "Next",
platform: 'FACEBOOK'
})
quickReplies1.addReply_("Cancel");
agent.add(quickReplies1);
}
So, the first step is to import the Suggestion module as:因此,第一步是将 Suggestion 模块导入为:
const {Suggestion} = require('dialogflow-fulfillment')
Then you can do something like your first function (I do not see any problem in your code).然后你可以像你的第一个 function 那样做(我没有看到你的代码有任何问题)。 Finally, you have to associate it with one of your intents:
最后,您必须将它与您的意图之一相关联:
let intentMap = new Map();
intentMap.set('Your intent's name', QuickReplies);
agent.handleRequest(intentMap);
Keep in mind that even if your intent has other components (text, cards) you can still append quick replies to it.请记住,即使您的意图有其他组件(文本、卡片),您仍然可以 append 快速回复它。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.