Botframework 我们可以在英雄卡中为长消息添加查看更多选项吗
我正在使用Microsoft bot framework,是否可以为英雄卡中的长消息提供选项“查看更多” 我的卡片正在渲染,我可以看到完整的文本。由于文本很长,聊天泡泡不适合在窗口中显示。我知道我们可以拆分文本并发送两次,但我的客户对查看更多选项非常具体 感谢您的帮助 谢谢Botframework 我们可以在英雄卡中为长消息添加查看更多选项吗,botframework,bots,chatbot,azure-bot-service,Botframework,Bots,Chatbot,Azure Bot Service,我正在使用Microsoft bot framework,是否可以为英雄卡中的长消息提供选项“查看更多” 我的卡片正在渲染,我可以看到完整的文本。由于文本很长,聊天泡泡不适合在窗口中显示。我知道我们可以拆分文本并发送两次,但我的客户对查看更多选项非常具体 感谢您的帮助 谢谢 Sanjeev取决于您连接到的频道。对于示例,在Facebook Messenger上,这是不可行的,因为此处允许的UI组件没有此选项 但对于其他支持此类功能的频道,您可能会找到其他解决方案,例如为支持大文本和许多其他内容的
Sanjeev取决于您连接到的频道。对于示例,在Facebook Messenger上,这是不可行的,因为此处允许的UI组件没有此选项 但对于其他支持此类功能的频道,您可能会找到其他解决方案,例如为支持大文本和许多其他内容的卡片设置动态高度 更新 我希望这会有所帮助,因为自适应卡中还没有“查看更多”选项,但有如下切换选项 转到并在左下角的卡有效负载编辑器中粘贴以下内容(替换原始json) 然后点击右上角的预览模式,然后点击预览卡,你将有一个切换动作
{
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "1.0",
"body": [
{
"type": "Container",
"selectAction": {
"type": "Action.ToggleVisibility",
"targetElements": [
"leg1Details"
]
},
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": "24px",
"items": [
{
"type": "Image",
"style": "Person",
"backgroundColor": "#0078D7",
"url": "http://messagecardplayground.azurewebsites.net/assets/smallairplane_white.png"
}
],
"type": "Column"
},
{
"width": "stretch",
"spacing": "Small",
"verticalContentAlignment": "Center",
"items": [
{
"type": "TextBlock",
"text": "**Depart:** Delta Air Lines flight 8471 to Paris"
}
],
"type": "Column"
}
]
},
{
"type": "ColumnSet",
"spacing": "None",
"columns": [
{
"width": "24px",
"items": [
{
"type": "Image",
"horizontalAlignment": "Center",
"width": "1px",
"url": "http://messagecardplayground.azurewebsites.net/assets/palebluedot1x1.png",
"height": "20px"
}
],
"type": "Column"
},
{
"width": "stretch",
"spacing": "Small",
"items": [
{
"type": "TextBlock",
"text": "Bengaluru, Sun 11/12/2017 1:55 AM, 10 hours 41 minutes",
"isSubtle": true
}
],
"type": "Column"
}
]
}
]
},
{
"type": "ColumnSet",
"id": "leg1Details",
"isVisible": false,
"spacing": "None",
"columns": [
{
"width": "24px",
"padding": "none",
"backgroundImage": {
"url": "http://messagecardplayground.azurewebsites.net/assets/palebluedot1x1.png",
"mode": "repeatVertically",
"horizontalAlignment": "Center"
},
"type": "Column"
},
{
"width": "stretch",
"spacing": "Small",
"items": [
{
"type": "Container",
"padding": {
"top": "default"
},
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": 45,
"items": [
{
"type": "Container",
"padding": "none",
"backgroundImage": "http://messagecardplayground.azurewebsites.net/assets/TxP_Background.png",
"items": [
{
"type": "Image",
"horizontalAlignment": "Center",
"url": "http://messagecardplayground.azurewebsites.net/assets/TxP_Flight.png"
}
]
},
{
"type": "Container",
"style": "emphasis",
"spacing": "None",
"items": [
{
"type": "TextBlock",
"text": "Flight to Paris",
"wrap": true,
"size": "ExtraLarge",
"weight": "Lighter",
"color": "Accent"
},
{
"type": "TextBlock",
"text": "Delta Air Lines flight 8471",
"wrap": true,
"size": "Medium",
"spacing": "Small"
},
{
"type": "TextBlock",
"wrap": true,
"text": "Confirmation code: ABCDEF",
"size": "Medium",
"spacing": "None"
},
{
"type": "TextBlock",
"wrap": true,
"text": "10 hours 45 minutes",
"size": "Medium",
"spacing": "None"
}
]
}
],
"type": "Column"
},
{
"width": 55,
"spacing": "None",
"padding": "default",
"items": [
{
"type": "Container",
"height": "stretch",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": "BLR",
"weight": "Lighter",
"size": "ExtraLarge"
}
],
"type": "Column"
},
{
"width": "stretch",
"verticalContentAlignment": "Center",
"items": [
{
"type": "Image",
"width": "10000px",
"url": "http://messagecardplayground.azurewebsites.net/assets/graydot2x2.png",
"height": "2px"
}
],
"type": "Column"
},
{
"width": "auto",
"spacing": "Small",
"verticalContentAlignment": "Center",
"items": [
{
"type": "Image",
"url": "http://messagecardplayground.azurewebsites.net/assets/smallairplane.png",
"height": "16px"
}
],
"type": "Column"
},
{
"width": "auto",
"items": [
{
"type": "TextBlock",
"text": "CDG",
"weight": "Lighter",
"horizontalAlignment": "Right",
"size": "ExtraLarge"
}
],
"type": "Column"
}
]
},
{
"type": "ColumnSet",
"columns": [
{
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "1:55 AM",
"size": "Medium"
}
],
"type": "Column"
},
{
"width": 1,
"items": [
{
"type": "TextBlock",
"text": "8:10 AM",
"horizontalAlignment": "Right",
"size": "Medium"
}
],
"type": "Column"
}
]
},
{
"type": "ColumnSet",
"spacing": "None",
"columns": [
{
"width": 1,
"items": [
{
"type": "TextBlock",
"isSubtle": true,
"wrap": true,
"text": "November 12, 2017"
}
],
"type": "Column"
},
{
"width": 1,
"items": [
{
"type": "TextBlock",
"isSubtle": true,
"wrap": true,
"text": "November 12, 2017",
"horizontalAlignment": "Right"
}
],
"type": "Column"
}
]
},
{
"type": "ColumnSet",
"spacing": "None",
"columns": [
{
"width": 1,
"items": [
{
"type": "TextBlock",
"isSubtle": true,
"text": "Bengaluru"
}
],
"type": "Column"
},
{
"width": 1,
"items": [
{
"type": "TextBlock",
"isSubtle": true,
"text": "Paris",
"horizontalAlignment": "Right"
}
],
"type": "Column"
}
]
}
]
},
{
"type": "ColumnSet",
"horizontalAlignment": "Right",
"separator": true,
"spacing": "Large",
"columns": [
{
"width": "auto",
"selectAction": {
"type": "Action.OpenUrl",
"url": "http://www.microsoft.com"
},
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": "auto",
"verticalContentyAlignment": "center",
"items": [
{
"type": "Image",
"url": "http://messagecardplayground.azurewebsites.net/assets/smallairplane.png",
"height": "16px"
}
],
"type": "Column"
},
{
"width": "auto",
"spacing": "Small",
"items": [
{
"type": "TextBlock",
"text": "Check in"
}
],
"type": "Column"
}
]
}
],
"type": "Column"
},
{
"width": "auto",
"spacing": "Large",
"selectAction": {
"type": "Action.OpenUrl",
"url": "http://www.microsoft.com"
},
"items": [
{
"type": "ColumnSet",
"columns": [
{
"width": "auto",
"verticalContentyAlignment": "center",
"items": [
{
"type": "Image",
"url": "http://messagecardplayground.azurewebsites.net/assets/calendaricon.png",
"height": "16px"
}
],
"type": "Column"
},
{
"width": "auto",
"spacing": "Small",
"items": [
{
"type": "TextBlock",
"text": "View in Calendar"
}
],
"type": "Column"
}
]
}
],
"type": "Column"
}
]
}
],
"type": "Column"
}
]
}
]
}
],
"type": "Column"
}
]
}
]}
谢谢你的回复。我需要在网页中托管我的bot。然后您将使用支持自适应卡的直连频道。所以我建议你去看看他们,并使用他们令人敬畏的功能!您也可以创建自己的自定义卡。我找不到更多可供查看的内容。也许我有更多的探索。你能帮我做这个吗。就像一些代码或其他东西一样,我试着按照你的建议工作,它在AdaptiveCardDesigner中工作得很好。当我尝试在我的bot中实现时,它不起作用。当我添加Action.ToggleVisibility按钮时,这些按钮不会呈现。但当我将类型更改为Action.ShowCard或openurl按钮时,正在加载。谢谢你,我很高兴它成功了!如果我的回答有帮助的话,如果你能接受或投票,那就太好了!如果你能更新你的答案,展示你是如何让它发挥作用的,那就太好了,这样其他人也会受益