【问题标题】:How to catch Facebook Card Response button click event in Dialogflow fulfillment如何在 Dialogflow 实现中捕获 Facebook 卡响应按钮单击事件
【发布时间】:2020-12-29 15:52:53
【问题描述】:

我已将 Dialogflow 代理连接到 Facebook 页面,并且我正在使用 Dialogflow 中的履行功能显示 Facebook 卡响应。我不知道如何捕捉卡片按钮点击事件。我需要聊天移动到按钮点击的下一个意图。但是按钮点击不会触发任何事情。

这是用于创建按钮的实现代码

function getState(agent){
state = agent.parameters.State;  
    return getAd()
    .then(result => {
     for(const item of result.result){
        agent.add(new Card({
         title: item.nmi,
         imageUrl: 'url',
         text: item.structuredAddress.singleAddressLine,
         buttonText: item.nmi,
         buttonUrl: 'uri'
      })
      );
    }
    })
    .catch(() => {
      agent.add(`I'm sorry.`);
    });

}`

【问题讨论】:

    标签: dialogflow-es dialogflow-es-fulfillment


    【解决方案1】:

    您可以使用回发按钮中的有效负载字段来发送 单击按钮时返回对话框流的特定消息。

    如果你把它和参数结合起来,你可以用它们来触发 特定的意图,或者只是为了发送产品的信息 点击了

    查看原答案Here

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2014-04-28
      • 2013-01-30
      • 1970-01-01
      • 2012-02-23
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多