I'm using the botframework C# with directlinejs to build my bot.
Recently I've noticed that my bot stoped working and I just find out that the problem is that the directline/botconnector or something in the middle is losing the "actions" node of my AdaptiveCard over directline. Here is the message that my bot (server) is sending to the client (botconnector and 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"
}
And here is the message that the botconnector/directlinejs is delivering to the client:
{
"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"
}
Note that the "Actions" node of my message was croped by something in the middle (botconnector or directlinejs, I don't know). Could anyone help me ?
I'm using the following version o botframework libs:
Microsoft.Bot.Builder version="3.14.1.1" Microsoft.Bot.Connector" version="3.14.1.1"
"type": "imBack"
is not a valid AdaptiveAction type.
For AdaptiveOpenUrlAction it should be "Action.OpenUrl"
https://github.com/Microsoft/AdaptiveCards/blob/6700649f154cf12da6d02e063325b396026993c6/source/dotnet/Library/AdaptiveCards/AdaptiveOpenUrlAction.cs#L24
For AdaptiveSubmitAction it should be “Action.Submit”
https://github.com/Microsoft/AdaptiveCards/blob/6700649f154cf12da6d02e063325b396026993c6/source/dotnet/Library/AdaptiveCards/AdaptiveSubmitAction.cs#L22