如何使用DialogueFlow ES和外部Webhook将通用模型的轮播发送到Facebook Messenger?

问题描述

我已经配置了一些步骤,如果我直接从webhook发送简单的答案,则一切运行正常。但是,如果我尝试使用有效负载发送旋转木马,则Webhook的响应不会到达Messenger中的最终用户,因此会返回我在dialogflow控制台中配置的标准响应。

function list_news(agent) {
    console.log("\n\n\n",agent,"\n\n\n")
    //agent.add("DEFAULT RESPONSE TO " + agent.requestSource + " FROM WEBHOOK");
    const payload = {
      "facebook": {
        "attachment": {
          "type": "template","payload": {
            "template_type": "generic","elements": [
              {
                "title": "Machine Learning For Dummies (English Edition)","image_url": "https://firebasestorage.googleapis.com/v0/b/universidade-qnej.appspot.com/o/livros%2FMachineLearning.jpg?alt=media&token=01ec5e95-d9ae-4f49-994e-f3c9d8a31405","subtitle": "It's the best book for beginners!","default_action": {
                  "type": "web_url","url": "https://www.amazon.com.br/AWS-CCP-Certified-Cloud-Practitioner-ebook/dp/B07JL64332/ref=sr_1_1?ie=UTF8&qid=1541085590&sr=8-1&keywords=aws+ccp","webview_height_ratio": "compact"
                },"buttons": [
                  {
                    "type": "web_url","url": "https://www.amazon.com.br/","title": "View Website"
                  }
                ]
              },{
                "title": "Machine Learning For Dummies (English Edition)","title": "View Website"
                  }
                ]
              }
            ]
          }
        }
      }
    }
    agent.add(new Payload('FACEBOOK',payload,{sendAsMessage: true}));
  }

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)