4

I am trying to format the text that is sent from the bot to the user like change font color,size etc.

Below are some of the methods that I tried to format the text.

text = "<b><p class=\"timestext\"> " + text + " </p></b>";
text = "<b><div style=\"color:rgb(255,255,0)\">" + text + "</div></b>";  
text = "<font color=\"rgb(255,255,0)\">" + text + "</font>";

HeroCard card = new HeroCard()
                {
                    Title = "Title",
                    Text = text,
                    Buttons = buttons_list
                };

In the above code, only the tag for bold works and font tag doesn't affect the text.

Can someone mention the problem in the above code or any method to format the text in bot framework.

Dipumon
  • 149
  • 2
  • 16
  • where is this ultimately being used? In a web page or somewhere else? – Simon Price Sep 23 '16 at 06:45
  • 3
    Text color is not supported: https://docs.botframework.com/en-us/csharp/builder/sdkreference/activities.html#xml – Caramiriel Sep 23 '16 at 06:49
  • It's different for each channel and not really possible. For Telegram there are some ways (formatting using Markdown) but not for Facebook for example. Don't do it, this is a horrible idea to change color text. –  Sep 23 '16 at 07:03
  • I am using this bot for skype channel. – Dipumon Sep 23 '16 at 07:09

1 Answers1

4

Channels vary in their support for editing text attributes. Currently none of the channels support customization of color or font. BotFramework formatting conventions can be found here, but you'll need to check each channel's documentation (i.e. Facebook / Skype / etc.) to see what subset they support.

Lars
  • 9,976
  • 4
  • 34
  • 40