Is it possible to show formatted HTML Content inside a Bot Card/Attachment?
In this Case, we retrieve the content field of a Dynamics 365 CRM Knowledge Article which is in HTML Format and want to show it to the bot user.
Most of the channels in the Bot Framework don't support HTML rendering. You may refer to this issue: Can a .html file be rendered in cards and HTML should be sanitized in messages.
One alternative way is that to extract information from your html and create cards to show them, to create cards in Bot Framework, please refer to the official Rich Cards Bot Sample for .NET SDK / Rich Cards Bot Sample for node.js SDK.
Another approach is that we use markdown to make a hyperlink to your html.
For example, in C#, you can simply code like this:
var text = #"[Google Search](http://www.google.com)";
await context.PostAsync(text);
But markdown is not supported by all channels too, you may refer to this Bot Framework markdown support by channel for more information.
Related
I recently saw the update in ServiceNow Bot in MS Team. The Activity view is evenly displayed and justified properly. How is this customization possible ?
Thanks for the idea
It looks to me that they're sending an Adaptive Card instead of a regular text message, but just one that doesn't have anything other than plain text in. So although Adaptive Cards can have rich content, these just look like better formatted plain text.
I am working on microsoft bot framework and I need to style the adaptive cards. But I am facing some challenges because in json file, I am unable to get the styling attribute. So, please suggest how I'll do this.
the style of Adaptive Cards is defined by the App the card is shown in. If you are using Bot Framework for like MS Teams, MS Teams defines the look and feel of a card. In the JSON layout you can select color for a button in terms of "Danger" or "Normal" but the actual color is defined by the host.
If you are showing cards in your own app however, you can define the layout by changing the host config. (see here for details : https://learn.microsoft.com/en-us/adaptive-cards/rendering-cards/host-config)
Only the rendering app can change the styling of cards.
Hope that answers your question.
I saw there are emojis attached with every message in microsoft teams.
Is it possible to implement the same scenario in webchat. if yes please help me to achieve it.
i also want a code snippet to render feedback thumbs up and thumbs down button in every bot response.
i need an explanary code snippet using javascript or jquery and a small demo(if possible).
The WebChat is easy to extend, thus your scenario should be possible. There is an example that is close to your needs.
Have a look at the WebChat documentation, sample 09.customization-reaction-buttons. (demo).
Introduces the ability to create custom components for Web Chat that
are unique to your bot's needs. This tutorial demonstrates the ability
to add reaction emoji such as 👍 and 👎 to conversational activities.
I have developed a FAQ Bot using C# and Bot Builder SDK 3.15.3. We have a large set of question/answer pairs which are uploaded to a QNA Maker Service. I have enabled the Direct Line Channel and the bot is displayed on a web page. I have used the Web Chat control provided by Microsoft with some customization and skinning.
Now I want to enable voice interaction with the bot, for that I decided to use the Microsoft Speech to Text Cognitive Service.
What I want to do is that when ever user speaks some utterance, I want to send the utterance to my bot service similar to like text is sent. Then inside C# code I want to run the Speech to Text and further do a Spell Check on the text retrieved and finally send to QNA Maker Service. The response for now will only be showed as text, but can also opt to read the response for the user.
Kindly guide my how this is achievable, as after looking at CognitiveService.js and other articles on enabling speech, I notice that Web Chat control directly sends the voice input to speech to text service.
You can make a hybrid between a calling bot which utilizes speech to text and a QnA bot to achieve your goal. For the calling bot, look over the SimpleIVRbot sample to get you going. For QnAMaker, you can reference the SimpleQnABot. It shouldn't take too much work bridging the two into a single unified bot. Just be sure to remove duplicate code and combine files where necessary.
Hope of help!
Can we use Markdown with Bot Framework for Skype for Business?
We implemented a code to send an image following the document below.
https://learn.microsoft.com/en-us/bot-framework/rest-api/bot-framework-rest-connector-create-messages
But it didn’t work. So we though Skype for Business may not be able to use Markdown feature.
Markdown is not currently a supported text format for Bot Framework bots on the Skype for Business channel.
For more information on supported message formats see: Skype for Business Bot Framework (Preview) > Feature Support
Messages : Your bot can send plain text, HTML, and emoticons to a user or group. Users can send rich text, HTML, and emoticons to your bot.
Note: HTML support is planned for mid-to-late June release.