简体   繁体   English

我如何通过 Dialogflow Fulfillment 将快速回复发送到 Facebook

[英]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.

相关问题 Dialogflow Web 集成不显示快速回复和多个回复 - Dialogflow Web Integration not showing Quick Replies and Multiple Replies 我可以通过 python API 获取 Dialogflow CX 中的所有 Route Fulfillment 消息吗? - Can I get all Route Fulfillment messages in Dialogflow CX by python API? 如何在 Dialogflow 实现中获取当前意图的名称? - How to get current intent's name in Dialogflow fulfillment? 代码在 Dialogflow 实现中不起作用 - code does not work in Dialogflow fulfillment Dialogflow ES 执行没有回复 - Dialogflow ES fulfillment did not reply 如何在不使用 webhook 客户端的情况下设置 dialogflow fulfillment response json 上下文? - How to set dialogflow fulfillment response json context without using webhook client? 如何使用 node.js 将信息从 mongodb 数据库传输到 dialogflow? - How can I transfer the information from mongodb database to dialogflow with node.js? 如何使用其 API 在 Dialogflow CX 中向意图添加新的训练短语? - How can I add new training phrases to an intent in Dialogflow CX using its API? 如果 parameter_A 的值出现在 parameter_B 中,我如何检查 Dialogflow CX? - How can I check in Dialogflow CX if the value of parameter_A appears in parameter_B? 有没有一种方法可以使用 dialogflow 应用程序实例使用谷歌客户端库上的操作直接设置实现消息 - Is there a way to directly set fulfillment messages using dialogflow app instance using actions on google client library
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM