I would like to return an Adaptive card via SendActivity in an Adaptive Dialog.
The code to do this looks like:
new OnIntent("Help")
{
Actions = new List<Dialog>()
{
new SendActivity("${Help-Root-Dialog()}")
}
},
But, I'd like to include a parameter in the call to create the adaptive card. Let's say a username (and therefore personalize the message to the user. Is there a way this can be done?
Found a few ways to do this:
new SetProperty()
{
Property = "conversation.gameCreateDate",
Value = DateTime.Now.ToString()
},
new SendActivity("${PlayGameCard()}"),
//In .lg file:
# PlayGameCard
[Activity
Attachments = ${json(AdaptiveCard.Definition())}
]
//...
{
"type": "TextBlock",
"spacing": "None",
"text": "Created ${conversation.gameCreateDate}",
"isSubtle": true,
"wrap": true
}
//...
await turnContext.SendActivityAsync(ActivityFactory.FromObject( _templates.Evaluate("SomethingWentWrong", exception)));
I used option 1, but 2 seems to be the way.