Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I deal with rich content with the Microsoft Bot Framework?

Tags:

botframework

I'm not sure how to deal with rich content. Some examples that I want to return are a list of hyperlinks or a/some image thumbnails. How do I do this? I tried formatting my text as HTML and that crashed the Bot Emulator and caused the Web Chat client to just display encoded HTML.

Is there a secret to this or some documentation explaining this?

like image 786
Jaxidian Avatar asked Mar 31 '16 22:03

Jaxidian


2 Answers

Markdown. Bot Framework converts Markdown to the rich native formats for each channel.

Some channels support even richer content via the ChannelData field (for example, you can send Slack Cards through our Slack channel in the ChannelData field) but all of our channels do the right thing for that channel if you send Markdown.

Edit: docs here: http://docs.botframework.com/connector/message-content/#the-text-property-is-markdown

like image 184
Dan Driscoll Avatar answered Sep 17 '22 14:09

Dan Driscoll


You may find github's link helpful:

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         ![duck](http://aka.ms/Fo983c)    

Note the channels will vary as to what subset of markdown they support.

like image 20
Lars Avatar answered Sep 16 '22 14:09

Lars