public async Task GreetingIntent(IDialogContext context, LuisResult result) { var replyMessage = context.MakeMessage(); ApodAttributes apod = await Apod.GetDetails(); Attachment attachment = await GetProfileHeroCardAsync(apod.url); replyMessage.Attachments = new List <Attachment> { attachment }; await context.PostAsync(replyMessage); }
public async Task <Attachment> GetProfileHeroCardAsync(string url) { ApodAttributes apod = await Apod.GetDetails(); var heroCard = new HeroCard { Title = string.Format(apod.title), Subtitle = string.Format(apod.Explanation), Tap = new CardAction(ActionTypes.OpenUrl, "Learn More", value: "http://antwrp.gsfc.nasa.gov/apod/astropix.html"), Images = new List <CardImage> { new CardImage(apod.url) }, }; return(heroCard.ToAttachment()); }