Closed vovanb closed 6 years ago
any update?
Hi @vovanb
It's possible to take the .json from the visualizer, include it as a file in the bot, and add it to a return message with the following code:
var path = HostingEnvironment.MapPath($"/Cards/{cardName}.JSON");
using (var f = File.OpenText(path))
{
string json = await f.ReadToEndAsync();
var results = AdaptiveCard.FromJson(json);
var card = results.Card;
returnMessage.Attachments.Add(new Attachment()
{
Content = card,
ContentType = AdaptiveCard.ContentType,
Name = "Card"
}) ;
return returnMessage;
}
There is no "Export to C#" option for Adaptive Cards though.
Adaptive card enable create configuration - Configuration editor on http://adaptivecards.io/visualizer/ How I can use it with MS bot?