Exemple #1
0
        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);
        }
Exemple #2
0
        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());
        }