我正在使用带有 directlinejs 的 botframework C# 来构建我的机器人。
最近我注意到我的机器人停止工作,我只是发现问题是直线/机器人连接器或中间的东西正在失去我的 AdaptiveCard 的“动作”节点而不是直线。这是我的机器人(服务器)发送给客户端(botconnector 和 directlinejs)的消息。
{
"$type": "Microsoft.Bot.Connector.Activity, Microsoft.Bot.Connector",
"type": "message",
"timestamp": "2018-04-19T17:57:14.565727+00:00",
"serviceUrl": "https://directline.botframework.com/",
"channelId": "directline",
"from": {
"$type": "Microsoft.Bot.Connector.ChannelAccount, Microsoft.Bot.Connector",
"id": "Toro@Q7xWzEtd_lk",
"name": "Toro Assistant"
},
"conversation": {
"$type": "Microsoft.Bot.Connector.ConversationAccount, Microsoft.Bot.Connector",
"id": "CfAgYrLQOuv9fDMPnfINDG"
},
"recipient": {
"$type": "Microsoft.Bot.Connector.ChannelAccount, Microsoft.Bot.Connector",
"id": "anonymous",
"name": "anonymous"
},
"text": "",
"attachments": {
"$type": "System.Collections.Generic.List`1[[Microsoft.Bot.Connector.Attachment, Microsoft.Bot.Connector]], mscorlib",
"$values": [
{
"$type": "Microsoft.Bot.Connector.Attachment, Microsoft.Bot.Connector",
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"$type": "AdaptiveCards.AdaptiveCard, AdaptiveCards",
"type": "AdaptiveCard",
"version": "1.0",
"body": {
"$type": "System.Collections.Generic.List`1[[AdaptiveCards.AdaptiveElement, AdaptiveCards]], mscorlib",
"$values": [
{
"$type": "AdaptiveCards.AdaptiveTextBlock, AdaptiveCards",
"type": "TextBlock",
"text": "Não se preocupe, cadastrar um novo número é muito fácil. É só clicar no botão abaixo.\r\n\r\n"
}
]
},
"actions": {
"$type": "System.Collections.Generic.List`1[[AdaptiveCards.AdaptiveAction, AdaptiveCards]], mscorlib",
"$values": [
{
"$type": "AdaptiveCards.AdaptiveOpenUrlAction, AdaptiveCards",
"type": "imBack",
"url": "http://toroinvestimentos.com.br/minhaconta/emailecelular/edit?q=phone&token=token",
"title": "Falar com Assessor"
},
{
"$type": "AdaptiveCards.AdaptiveSubmitAction, AdaptiveCards",
"type": "imBack",
"data": "Mudar de assunto",
"title": "Mudar de assunto",
"image": "https://toro.azureedge.net/bot/icon_list_default.svg"
}
]
},
"style": "ToroCard1"
}
}
]
},
"entities": {
"$type": "System.Collections.Generic.List`1[[Microsoft.Bot.Connector.Entity, Microsoft.Bot.Connector]], mscorlib",
"$values": []
},
"replyToId": "CfAgYrLQOuv9fDMPnfINDG|0000011"
}
这是 botconnector/directlinejs 传递给客户端的消息:
{
"type": "message",
"id": "CfAgYrLQOuv9fDMPnfINDG|0000012",
"timestamp": "2018-04-19T17:57:14.9161386Z",
"localTimestamp": "2018-04-19T17:57:14.6134302+00:00",
"channelId": "directline",
"from": {
"id": "Toro",
"name": "Toro Assistant"
},
"conversation": {
"id": "CfAgYrLQOuv9fDMPnfINDG"
},
"text": "",
"attachments": [
{
"contentType": "application/vnd.microsoft.card.adaptive",
"content": {
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "TextBlock",
"text": "Não se preocupe, cadastrar um novo número é muito fácil. É só clicar no botão abaixo.\r\n\r\n"
}
],
"style": "ToroCard1"
}
}
],
"entities": [],
"replyToId": "CfAgYrLQOuv9fDMPnfINDG|0000011"
}
请注意,我的消息的“Actions”节点被中间的某些东西裁剪(botconnector 或 directlinejs,我不知道)。谁能帮助我?
我正在使用以下版本的 botframework 库:
Microsoft.Bot.Builder 版本="3.14.1.1" Microsoft.Bot.Connector" 版本="3.14.1.1"