直线 API - Bot Framework / Hero Cards and Attachments

Direct Line API - Bot Framework / Hero Cards and Attachments

我刚开始使用 Direct Line API (1.1),我发现它不会让你知道对话是否显示在英雄卡或按钮中。

{
      "id": "fBPDq9JSeL|000000000000000004",
      "conversationId": "fBPDq9JSeL",
      "created": "2016-11-28T20:22:20.6035604Z",
      "from": "portosegurobot",
      "text": "Health For Pets\n\nNossa missão é proporcionar a cães e gatos uma vida mais saudável e feliz.\n\nAcesse e saiba mais\n\n(Acesse) https://health4pet.com.br/",
      "images": [],
      "attachments": [],
      "eTag": "W/\"日期时间'2016-11-28T20%3A22%3A21.3990939Z'\""
    }

上面的代码(在模拟器中)显示在带有按钮(卡片操作)的英雄卡片中。 Direct Line API 没有标记吗?有办法吗?

DirectLine v1.1 不支持英雄卡片/附件;您不会收到附件集中的任何内容。

如果你想支持卡片,你可能需要做一些自定义,如 DirectLine sample. There, the bot is sending the hero card through the ChannelData field and the client is parsing that 中所示。

我没有使用过 DirectLine v3.0,但基于 documentation 看来现在可能支持附件,所以您可能想看看。