public async Task WhatAreBots(IDialogContext context, LuisResult result)
        {
            bool isguggs = false;

            context.UserData.TryGetValue <bool>("isguggs", out isguggs);
            if (isguggs)
            {
                XDocument dialog  = UIBuilder.CreateDialog();
                var       message = context.MakeMessage();

                UIBuilder.AppendLabel(dialog, "Tell folks to come to the next presentation after this. I'll discuss about bots with the help of my assistant, Mat in the conference room 122.");
                UIBuilder.AppendLabel(dialog, "(don't tell him I said that)");
                UIBuilder.AppendLabel(dialog, "But if you want to give people an overview of bots architecture, perhaps start here:");
                UIBuilder.AppendLink(dialog, "https://aka.ms/botarchitecture");
                this.AddCustomCard(message, dialog);

                await context.PostAsync(message);

                context.Wait(MessageReceived);
            }
            else
            {
                XDocument dialog = UIBuilder.CreateDialog();
                UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking);
                UIBuilder.AppendLabel(dialog, "Different people have different views on bots:");
                IMessageActivity message = context.MakeMessage();
                this.AddCustomCard(message, dialog);

                await context.PostAsync(message);


                dialog = UIBuilder.CreateDialog();
                string[] items = new string[] {
                    "Some people think bots are all about <say-as type=\"letters\">AI</say-as>.",
                    "Others say it's all about natural language.",
                    "And some will say it's all about messaging"
                };
                UIBuilder.AppendBulletList(dialog, items);
                UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter);

                message = context.MakeMessage();

                this.AddCustomCard(message, dialog);

                await context.PostAsync(message);

                context.Wait(MessageReceived);
            }
        }
        private async Task ArchitectureConfirm(IDialogContext context, IAwaitable <string> result)
        {
            string answer = await result;

            if (answer.ToLower().Contains("no"))
            {
                await context.PostAsync("OK, never mind then...");

                context.Wait(MessageReceived);
            }
            else
            {
                XDocument dialog = UIBuilder.CreateDialog();
                UIBuilder.SetClearScreen(dialog, true);
                UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile);
                UIBuilder.AppendLabel(dialog, "There you go!");
                UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/xray.png");
                IMessageActivity message = context.MakeMessage();
                this.AddCustomCard(message, dialog);
                await context.PostAsync(message);

                await Task.Delay(5000);

                message = context.MakeMessage();
                dialog  = UIBuilder.CreateDialog();


                UIBuilder.AppendLabel(dialog, "I am so funny sometimes... But seriously, you should explain them yourself now. Perhaps start with this link:");
                UIBuilder.AppendLink(dialog, "https://aka.ms/botarchitecture");

                UIBuilder.AppendLabel(dialog, "But here's my source code if you want to take a look at it:");
                UIBuilder.AppendLink(dialog, "http://www.github.com/matvelloso/presenterbot");


                this.AddCustomCard(message, dialog);

                await context.PostAsync(message);

                context.Wait(MessageReceived);
            }
        }
Exemple #3
0
        private async Task ArchitectureConfirm(IDialogContext context, IAwaitable <string> result)
        {
            string answer = await result;

            if (answer.ToLower().Contains("não"))
            {
                await context.PostAsync("<prosody rate=\"fast\">OK, esquece...</prosody>");

                context.Wait(MessageReceived);
            }
            else
            {
                XDocument dialog = UIBuilder.CreateDialog();
                UIBuilder.SetClearScreen(dialog, true);
                UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile);
                UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Aqui vai!</prosody>");
                UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/xray.png");
                IMessageActivity message = context.MakeMessage();
                this.AddCustomCard(message, dialog);
                await context.PostAsync(message);

                await Task.Delay(5000);

                message = context.MakeMessage();
                dialog  = UIBuilder.CreateDialog();


                UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Eu sou tão engraçado... Mas sério, você devia explicar para audiência agora. Talvez comece por esse link:</prosody>");
                UIBuilder.AppendLink(dialog, "https://aka.ms/botarchitecture");

                UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Mas aqui está meu código fonte se você quiser ver:</prosody>");
                UIBuilder.AppendLink(dialog, "http://www.github.com/matvelloso/presenterbot");

                this.AddCustomCard(message, dialog);

                await context.PostAsync(message);

                context.Wait(MessageReceived);
            }
        }
Exemple #4
0
        private async Task ArchitectureConfirm(IDialogContext context, IAwaitable <string> result)
        {
            string answer = await result;

            if (answer.ToLower().Contains("no"))
            {
                await context.PostAsync("OK, no importa entonces...");

                context.Wait(MessageReceived);
            }
            else
            {
                XDocument dialog = UIBuilder.CreateDialog();
                UIBuilder.SetClearScreen(dialog, true);
                UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile);
                UIBuilder.AppendLabel(dialog, "¡Aquí tienes!");
                UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/xray.png");
                IMessageActivity message = context.MakeMessage();
                this.AddCustomCard(message, dialog);
                await context.PostAsync(message);

                await Task.Delay(5000);

                message = context.MakeMessage();
                dialog  = UIBuilder.CreateDialog();


                UIBuilder.AppendLabel(dialog, "Soy tan gracioso a veces... Pero en serio, ahora vos deberias explicarle esto a la audiencia. Tal vez podrias comenzar con este link:");
                UIBuilder.AppendLink(dialog, "https://aka.ms/botarchitecture");

                UIBuilder.AppendLabel(dialog, "Pero aquí está mi código fuente si quieres darle una mirada:");
                UIBuilder.AppendLink(dialog, "http://www.github.com/matvelloso/presenterbot");

                this.AddCustomCard(message, dialog);

                await context.PostAsync(message);

                context.Wait(MessageReceived);
            }
        }