Direct Line API - Bot Framework / Hero Cards and Attachments

試著忘記壹切 提交于 2019-12-11 01:46:11

问题


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'\""
    }

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?


回答1:


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

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.

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.



来源:https://stackoverflow.com/questions/40852909/direct-line-api-bot-framework-hero-cards-and-attachments

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!