I am trying to use Microsoft Bot Connector API - v3.0 for creating the bot for Skype.
Incoming messages could be either in HTML encoding (so, I should use HttpUtility.HtmlDecode(...) to process them properly) or not. And, there are no any properties or methods in activity object, that could explain, either I should decode the message, or not. So, for the exact message I can't understand, how to process it.
For example, the message
http://www.com <<'>>
appears in the bot as
<a href="http://www.com">http://www.com</a> <<'>>
but the message
<<'>>
appears in the bot as
<<'>>
The bigger problem is a format of outgoing messages. For example, my bot has to send the following message:
http://ux.ua UX
http://ex.ua <body>
When I send it without encoding (as is), the message doesn't reach the client.
When I send it after using HttpUtility.HtmlEncode(...), the message reaches the client, but it appears, as
http://ux.ua UX
http://ex.ua <body>
Unfortunately, the result of the following code:
await _connector.Conversations.ReplyToActivityAsync(message);
the same in both cases (it is null), so my bot can't even determine if the message has reached the client.
From https://docs.botframework.com/en-us/csharp/builder/sdkreference/activities.html
TextFormat Property
Each message has an optional TextFormat property which represents how to interpret the Text property.
plain The text should be treated as raw text and no formatting applied at all
markdown The text should be treated as markdown formatting (DEFAULT)
xml The text is simple XML markup (subset of HTML) Skype Only
XML
Skype supports a subset of HTML tags it calls XML Markup (sometimes referred to as XMM).
The tags that are supported are:
Style Markdown Description Example
Bold text make the text bold text
Italic text make the text italic text
Underline text Mark a line as underline text
Strikethrough text make the text strikethrough text
link bing create a hyperlink with title bing
Set your "textFormat":"xml" and I think it should be what you want.
How do we set the TextFormat with the node js library?
How to do this in nodejs ??
Most helpful comment
How do we set the TextFormat with the node js library?