首页 > 解决方案 > 有没有办法从 Fulfillment Webhook 发回快速回复?

问题描述

我一直在玩 DialogFlow 和 Fulfillment 但直到现在我总是将 FulfillmentText 从我的 webhook 返回到我的机器人,如下所示:

response = {
    fulfillmentText: "Some message!"
};

有没有办法在这里返回一组选项(快速回复)?基本上我想返回 3 个按钮,选项 a、b 和 c 各一个。这可能吗?

谢谢!

编辑:

我可以使用以下代码发回一张卡片,但我找不到任何可以发回快速回复而不是卡片的样本。

"fulfillmentMessages": [
    {
      "card": {
        "title": "card title",
        "subtitle": "card text",
        "imageUri": "https://assistant.google.com/static/images/molecule/Molecule-Formation-stop.png",
        "buttons": [
          {
            "text": "button text",
            "postback": "https://assistant.google.com/"
          }
        ]
      }
    }
  ],

标签: javascriptbotsdialogflow-es

解决方案


这是一个例子:

fulfillmentMessages: [
    {
        quickReplies: {
            title: 'Hello',
            quickReplies: [
                'First Reply',
                'Second Reply',
            ],
        },
        platform: 'FACEBOOK'
     },
};

另外,这是诀窍:) https://miningbusinessdata.com/how-to-send-any-facebook-messenger-rich-response-from-dialogflow-webhook/


推荐阅读