我不确定如何处理丰富的内容。我想要返回的一些示例是超链接列表或/某些图像缩略图。我该怎么做呢?我尝试将我的文本格式化为HTML并使Bot Emulator崩溃并导致Web Chat客户端只显示编码的HTML。
这个或一些文件是否有秘密解释这个?
答案 0 :(得分:10)
减价。 Bot Framework将Markdown转换为每个频道的丰富原生格式。
某些频道通过ChannelData字段支持更丰富的内容(例如,您可以通过ChannelData字段中的Slack频道发送Slack卡)但是如果您发送Markdown,我们所有频道都会为该频道做正确的事情。
编辑:此处的文档:http://docs.botframework.com/connector/message-content/#the-text-property-is-markdown
答案 1 :(得分:7)
您可能会发现github的链接很有用:
https://guides.github.com/features/mastering-markdown/
Style Markdown Description Example
Bold **text** make the text bold
Italic *text* make the text italic
Header1-5 # H1 Mark a line as a header
Strikethrough ~~text~~ make the text strikethrough
Hr --- insert a horizontal rule
Unordered list * Make an unordered list item
Ordered list 1. Make an ordered list item starting at 1
Pre `text` Preformatted text(can be inline)
Block quote > text quote a section of text
link [bing](http://bing.com)
image link 
请注意,频道会因其支持的降价子集而有所不同。
答案 2 :(得分:0)
https://docs.botframework.com/en-us/core-concepts/channeldata 示例附件https://api.slack.com/docs/message-attachments 你必须在下面的代码中更改源和扭曲附件。 我能够处理冗余的文件 在Microsoft bot框架
中使用丰富的内容来参考这个松弛的例子enter code here
bot.dialog('/', function (session) {
session.send('Looking into your upcoming flights to see if you check-in on any of those...');
var card = {
slack: {
"attachments": [
{
"fallback": "Required plain-text summary of the attachment.",
"color": "#36a64f",
"pretext": "Optional text that appears above the attachment block",
"author_name": "Bobby Tables",
"author_link": "http://flickr.com/bobby/",
"author_icon": "http://flickr.com/icons/bobby.jpg",
"title": "Slack API Documentation",
"title_link": "https://api.slack.com/",
"text": "Optional text that appears within the attachment",
"fields": [
{
"title": "Priority",
"value": "High",
"short": false
}
],
"image_url": "http://my-website.com/path/to/image.jpg",
"thumb_url": "http://example.com/path/to/thumb.png",
"footer": "Slack API",
"footer_icon": "https://platform.slack-edge.com/img/default_application_icon.png",
"ts": 123456789
}
]
}
}
var msg = new builder.Message(session).sourceEvent(card);
session.send(msg);
});
答案 3 :(得分:0)
通过一些示例,您可能会发现此线程很有用,是的,MD就是答案。
https://github.com/microsoft/BotFramework-WebChat/issues/2289
所以说,如果你想做一个无序列表。
Unordered list\r\n\r\n* An item\r\n* Another item\r\n* Yet another item\r\n* And there\'s more...\r\n\r\n
无序列表