This post is about how can we do text formatting in the Microsoft Bot framework.
Like, how to send or receive text in bold, italics, list, quote, links etc.
- Bold and Italics
//bold session.send("Hello, **You said**, %s", session.message.text);
//italics session.send("Hello, *You said* %s, session.message.text");
//bold and italics both session.send("***This text is bold and italics both***");
- Multiline Text
//multiline session.send("What is your name?\n\nWhat is your age?\n\nWhere do you live?");
- List
//lists session.send("Hi, Below is my list\n\n"+ "* Item 1\n\n"+ "* Item 2\n\n"+ "Item 1 ");
- Strikethrough text
//strikethrough session.send("~~This is strike through~~");
- Quote a text
//quote session.send("Block quote below bar \n\n"+ "---"+ "\n\n> This is how you write quotes in here. Hope you like it.\n\n"+ "-BOT");
- Adding Links
//links session.send("This is link: [bing](http://www.bing.com)");
- Adding text in increased font(a heading)
session.send("# This is big text\n\n"+ "This is normal text");
Hope it helps you when you are developing a chat bot using Microsoft Bot Framework.
Note: These formatting may not work on all channels like facebook messenger.