Direct Line API-Bot框架/英雄卡和附件 [英] Direct Line API - Bot Framework / Hero Cards and Attachments

查看:93
本文介绍了Direct Line API-Bot框架/英雄卡和附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我刚刚开始使用Direct Line API(1.1),但我发现它并没有让您知道对话是在英雄卡还是按钮内显示的.

I just started using the Direct Line API (1.1) and I saw that it doesn't let you know if a conversation was showed inside a Hero Card or a Button for example.

 {
      "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/\"datetime'2016-11-28T20%3A22%3A21.3990939Z'\""
    }

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

The code above was showed (in the emulator) in a hero Card with a Button (card action). The Direct Line API doens't flag that? Is there a way?

推荐答案

DirectLine v1.1不支持英雄卡/附件;您不会在附件集合中收到任何东西.

Hero cards / attachments are not supported in DirectLine v1.1; you won't receive anything in the attachments collection.

如果要支持Cards,则可能必须做一些自定义操作,如 DirectLine 示例.在那里,机器人是发送英雄卡(通过ChannelData字段),客户端为

If you want to support Cards, you might have to do something custom as shown in the DirectLine sample. There, the bot is sending the hero card through the ChannelData field and the client is parsing that accordingly.

我没有使用DirectLine v3.0,而是基于文档 a>似乎现在可以支持附件了,所以您可能需要看一下.

I haven't used DirectLine v3.0, but based on the documentation it seems that now attachments might be supported so you might want to take a look to that.

这篇关于Direct Line API-Bot框架/英雄卡和附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆