public async Task GuggsGreetingConfirm(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; if (answer.ToLower().Contains("no")) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendLabel(dialog, "Oh, ok"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.MessageReceived); } else { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown); UIBuilder.AppendLabel(dialog, "Is there a lot of people there? I'm <prosody rate=\"slow\">nervous... </prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } }
public async Task CantDoChart(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.antenna_glow); UIBuilder.AppendLabel(dialog, "You think so? Let me show you a chart:"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart.png"); UIBuilder.AppendLabel(dialog, "See, this is a Power <say-as type=\"letters\">BI</say-as> chart showing how wrong you are"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); await Task.Delay(13000); dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart2.png"); UIBuilder.AppendLabel(dialog, "See there? <prosody pitch=\"x-low\" rate=\"x-slow\">You</prosody>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); UIBuilder.AppendLabel(dialog, "But seriously: Would you find me more interesting if all I could do was text? The real natural experiences are a mix of everything, including text, rich controls and voice. <prosody pitch=\"x-low\" rate=\"slow\">I can do it all</prosody>"); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task CantDoChart(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.antenna_glow); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Ah, você acha? Veja só:</prosody>"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart.png"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Esse é um gráfico em Power <phoneme alphabet=\"x-microsoft-ups\" ph=\"B I . A I\">BI</phoneme> mostrando o quanto você está errado</prosody>"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); await Task.Delay(13000); dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart2.png"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Viu? Ali, ó:</prosody> <prosody pitch=\"x-high\" rate=\"slow\">Você</prosody>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Mas falando sério: Você ia me achar mais interessante se eu só soubesse me comunicar por texto? As experiências realmente naturais são uma mistura de tudo: Texto, voz, interface gráfica, tudo junto.</prosody>"); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task WhatAreBots(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "Las personas tienen distintas opiniones sobre los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>:"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); dialog = UIBuilder.CreateDialog(); string[] items = new string[] { "Algunas personas piensan que son programas de inteligencia artificial", "Otras dicen que son sistemas de lenguage natural.", "Y muchos dicen que son programas enfocados en mensajeria" }; UIBuilder.AppendBulletList(dialog, items); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task CantDoChart(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.antenna_glow); UIBuilder.AppendLabel(dialog, "Ahhhhh, ¿eso crees? Permitime mostrarte un gráfico"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart.png"); UIBuilder.AppendLabel(dialog, "Este es un gráfico de Power <phoneme alphabet=\"x-microsoft-ups\" ph=\"B I . A I\">BI</phoneme> mostrando lo equivocado que estas"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); await Task.Delay(13000); dialog = UIBuilder.CreateDialog(); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/chart2.png"); UIBuilder.AppendLabel(dialog, "¿Ves ahi? <prosody pitch=\"x-high\" rate=\"slow\">Ese sos vos</prosody>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); UIBuilder.AppendLabel(dialog, "Pero en serio, ¿Me encontrarías más interesante si todo lo que pudiera hacer fuera solo texto? Las experiencias realmente naturales son una mezcla de todo, incluyendo texto, controles ricos, voz. <prosody pitch=\"x-low\" rate=\"slow\">Yo puedo hacerlo todo</prosody>."); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task WhatAreBots(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">As pessoas têm opiniões diferentes sobre <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>:</prosody>"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); dialog = UIBuilder.CreateDialog(); string[] items = new string[] { "<prosody rate=\"fast\">Algumas pessoas pensam que são programas de inteligência artificial.</prosody>", "<prosody rate=\"fast\">Outras dizem que são sistemas de linguagem natural.</prosody>", "<prosody rate=\"fast\">E muitos dizem que são programas focados em sistemas de mensagens</prosody>" }; UIBuilder.AppendBulletList(dialog, items); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
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); } }
public async Task Greetings(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "Testing, 1, 2, 3. Can you hear me?"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.GreetingsConfirm); }
public async Task Greetings(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Testando, 1, 2, 3. Consegue me ouvir?</prosody>"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.GreetingsConfirm); }
public async Task WhatIsYourOpinion(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.shrug); UIBuilder.AppendLabel(dialog, "I believe bots are just apps. You see, we may have <say-as type=\"letters\">AI</say-as>, but we may just as well be very simple. We may use natural language, but maybe not. These things don't define what bots are. We are apps, that's it."); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task WhatAboutTheFuture(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "Puedo darte una idea, pero ¿puedo reproducir música? Esto va a ser mejor con música."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.Music); }
public async Task WhatAboutTheFuture(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "I can give you an idea, but can I play some music? This works best with music..."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.Music); }
public async Task GuggsGreeting(IDialogContext context, LuisResult result) { context.UserData.SetValue <bool>("isguggs", true); XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "Hey there! Are you presenting the keynote?"); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.GuggsGreetingConfirm); }
public async Task WhatIsYourOpinion(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.shrug); UIBuilder.AppendLabel(dialog, "Creo que los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> son solo apps. Mirá, podemos tener inteligencia artificial, pero tambien podemos ser muy simples. Podemos usar un lenguaje natural, pero tambien podemos no usarlo. Estas cosas no definen lo que son los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>. Somos solo eso: apps."); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
public async Task WhatAboutTheFuture(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Eu posso te dar uma ideia, mas posso tocar uma música? Isso funciona melhor com música...</prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.Music); }
public async Task WhatIsYourOpinion(IDialogContext context, LuisResult result) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.shrug); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Eu acredito que <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> são apenas apps. Veja, nós podemos ter inteligência artificial, mas podemos também ser muito simples. Nós podemos usar linguagem natural, mas em muitos casos nós não usamos nada disso. Essas coisas não definem <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>. Nós somos apenas isso: apps.</prosody>"); UIBuilder.SetClearScreen(dialog, true); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.enter); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); }
private async Task Music(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; 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.AppendMusic(dialog, "./Content/Music2.mp3"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Os <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> estão evoluindo. Texto apenas não basta.</prosody>"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/Skypecards.png"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Skype tem uma interface gráfica rica que nós chamamos de cards.</prosody>"); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/slack.png"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Slack, Facebook e outros estão seguindo o mesmo caminho.</prosody>"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Enquanto uma app multi plataforma típica é muito cara de se construir e suportar, <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> são simples.</prosody>"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Apenas imagine apps que existem em qualquer lugar e podem ser usadas até quando você não pode ver ou usar suas mãos, usando apenas áudio.</prosody>"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">E ao mesmo tempo, podem ser ricas quando um desktop está disponível. Quer uma interface gráfica rica? Nós podemos fazer isso</prosody>"); UIBuilder.AppendIframe(dialog, "http://www.azurelens.net"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Então você quer saber como o futuro dos <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> vai ser? Eu te digo:</prosody>"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">O futuro dos <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> parece muito com apps.</prosody>"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">E o futuro das apps parece muito com <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>.</prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.wave_flag); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Porque a experiência mais natural é uma combinação de tudo.</prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.wave_flag_end); UIBuilder.AppendCalendar(dialog, DateTime.Now); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } }
private async Task Music(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; 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.AppendMusic(dialog, "./Content/Music2.mp3"); UIBuilder.AppendLabel(dialog, "Los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> están evolucionando. Texto solo ya no alcanza."); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/Skypecards.png"); UIBuilder.AppendLabel(dialog, "Skype tiene una interfaz gráfica rica. La llamamos cards."); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/slack.png"); UIBuilder.AppendLabel(dialog, "Slack, Facebook y otros estan siguiendo el mismo camino."); UIBuilder.AppendLabel(dialog, "Mientras que una típica aplicación multi-plataforma es muy costosa de construir y mantener, los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> son simples."); UIBuilder.AppendLabel(dialog, "Solo imagina aplicaciones que existan en todas partes y que se puedan usar aunque no se puedan ver o no se puedan utilizar las manos, usando solo audio."); UIBuilder.AppendLabel(dialog, "Y que al mismo tiempo, pueden ser ricas cuando una computadora de escritorio esta disponible. ¿Queres una interfaz gráfica rica? Podemos hacerlo"); UIBuilder.AppendIframe(dialog, "http://www.azurelens.net"); UIBuilder.AppendLabel(dialog, "¿Así que queres saber como va a ser el futuro de los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>? Yo te digo:"); UIBuilder.AppendLabel(dialog, "El futuro de los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme> se parece mucho a las aplicaciones"); UIBuilder.AppendLabel(dialog, "Y el futuro de las aplicaciones se parece mucho a los <phoneme alphabet=\"x-microsoft-ups\" ph=\"B AO . T S\">bots</phoneme>."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.wave_flag); UIBuilder.AppendLabel(dialog, "Porque la experiencia de usuario más natural es una combinacion de todo."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.wave_flag_end); UIBuilder.AppendCalendar(dialog, DateTime.Now); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } }
private async Task Music(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; 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.AppendMusic(dialog, "./Content/Music2.mp3"); UIBuilder.AppendLabel(dialog, "Bots are evolving. Just text isn't enough anymore."); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/Skypecards.png"); UIBuilder.AppendLabel(dialog, "Skype has a range of rich controls. We call them cards."); UIBuilder.AppendImage(dialog, "https://presenterbot.blob.core.windows.net/images/slack.png"); UIBuilder.AppendLabel(dialog, "Slack, Facebook and others are following the same path."); UIBuilder.AppendLabel(dialog, "While a typical cross platform app is very expensive to build and support. Bots are simple."); UIBuilder.AppendLabel(dialog, "Just imagine apps that exist anywhere and can be used even if you can't see, via audio only."); UIBuilder.AppendLabel(dialog, "And at the same time, can be rich when a desktop is available. Want a rich user interface control? We can do that"); UIBuilder.AppendIframe(dialog, "http://www.azurelens.net"); UIBuilder.AppendLabel(dialog, "So you want to know how the future looks like? I tell you:"); UIBuilder.AppendLabel(dialog, "The future of bots looks more like apps."); UIBuilder.AppendLabel(dialog, "And the future of apps looks more like bots."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.wave_flag); UIBuilder.AppendLabel(dialog, "Because the most natural user experience is all of it combined."); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.wave_flag_end); UIBuilder.AppendCalendar(dialog, DateTime.Now); IMessageActivity 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); } }
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); } }
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); } }
public async Task GreetingsConfirm(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; if (answer.ToLower().Contains("não")) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">E agora?</prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.GreetingsConfirm); } else { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Ah, <emphasis level=\"strong\">ótimo</emphasis>! Olá!</prosody>"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } }
private async Task TrickConfirm(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 { if (SkypeDialog.resumptionCookie == null)//We don't know who you are on Skype yet... { await context.PostAsync("Necesito registrarte en Skype primero. Hablá conmigo en Skype y deci \"registrar\""); context.Wait(MessageReceived); } else //We will use the resumption cookie and talk to you { var resumptionCookie = SkypeDialog.resumptionCookie; await ResumeSkype.Resume(resumptionCookie); var dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.dance); UIBuilder.AppendLabel(dialog, "<prosody pitch=\"x-high\" volume=\"x-loud\">Tener nervios de acero!</prosody> jajajajja"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.dance_end); UIBuilder.AppendLabel(dialog, "¿Ves? Puedo comunicarme con vos a través de diferentes canales usando voz, texto e interfaces graficas y puedo llevar conmigo la configuración y los datos de contexto."); UIBuilder.AppendLabel(dialog, "Para aplicaciones típicas, estas cosas son muy difíciles de hacer"); var message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } } }
private async Task TrickConfirm(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 { if (SkypeDialog.resumptionCookie == null)//We don't know who you are on Skype yet... { await context.PostAsync("<prosody rate=\"fast\">Eu preciso registrar você no Skype primeiro. Converse comigo no Skype e diga \"registrar\"</prosody>"); context.Wait(MessageReceived); } else //We will use the resumption cookie and talk to you { var resumptionCookie = SkypeDialog.resumptionCookie; await ResumeSkype.Resume(resumptionCookie); var dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.dance); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\" pitch=\"x-high\" volume=\"x-loud\">Bota aqui o seu pezinho!</prosody> haha!"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.dance_end); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Viu? Eu posso me comunicar com você usando canais diversos, tanto via voz como texto e interfaces gráficas e eu levo comigo suas configurações e contexto de dados.</prosody>"); UIBuilder.AppendLabel(dialog, "<prosody rate=\"fast\">Em uma app típica isso seria muito difícil de fazer.</prosody>"); var message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } } }
public async Task GreetingsConfirm(IDialogContext context, IAwaitable <IMessageActivity> item) { string answer = (await item).Text; if (answer.ToLower().Contains("no")) { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown); UIBuilder.AppendLabel(dialog, "What about now?"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.frown_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(this.GreetingsConfirm); } else { XDocument dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.thinking_end); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile); UIBuilder.AppendLabel(dialog, "Oh <emphasis level=\"strong\">great</emphasis>! Hi there!"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.smile_end); IMessageActivity message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } }
private async Task TrickConfirm(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 { if (SkypeDialog.resumptionCookie == null)//We don't know who you are on Skype yet... { await context.PostAsync("I need to register you on Skype first. Talk to me on Skype and say \"register\""); context.Wait(MessageReceived); } else //We will use the resumption cookie and talk to you { var resumptionCookie = SkypeDialog.resumptionCookie; await ResumeSkype.Resume(resumptionCookie); var dialog = UIBuilder.CreateDialog(); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.dance); UIBuilder.AppendLabel(dialog, "<prosody pitch=\"x-high\" volume=\"x-loud\">Kiss my bot!</prosody> haha!"); UIBuilder.AppendAnimation(dialog, UIBuilder.Animation.dance_end); UIBuilder.AppendLabel(dialog, "See? I can reach you using different channels using both voice and text and I can carry your settings and context data with me."); UIBuilder.AppendLabel(dialog, "For typical apps, these things are very hard to do."); var message = context.MakeMessage(); this.AddCustomCard(message, dialog); await context.PostAsync(message); context.Wait(MessageReceived); } } }