Created
March 21, 2019 16:27
-
-
Save ikivanc/d8d06c02e3a1728db5d59af27a66548e to your computer and use it in GitHub Desktop.
AdaptiveCard
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// 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