Exemplo n.º 1
0
        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);
                }
            }
        }
Exemplo n.º 2
0
        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);
                }
            }
        }
Exemplo n.º 3
0
        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);
                }
            }
        }