Skip to content

Instantly share code, notes, and snippets.

@ikivanc
Created March 21, 2019 16:27
Show Gist options
  • Save ikivanc/d8d06c02e3a1728db5d59af27a66548e to your computer and use it in GitHub Desktop.
Save ikivanc/d8d06c02e3a1728db5d59af27a66548e to your computer and use it in GitHub Desktop.
AdaptiveCard
// Reply to the activity we received with an activity.
var reply = turnContext.Activity.CreateReply();
// combine path for cross platform support
string[] paths = { ".", "Resources", "adaptiveCard.json" };
var adaptiveCardJson = File.ReadAllText(Path.Combine(paths));
var adaptiveCardAttachment = new Attachment()
{
ContentType = "application/vnd.microsoft.card.adaptive",
Content = JsonConvert.DeserializeObject(adaptiveCardJson),
};
reply.Attachments.Add(adaptiveCardAttachment);
// Send the card(s) to the user as an attachment to the activity
await turnContext.SendActivityAsync(reply, cancellationToken);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment