Пример #1
0
        protected override async Task PostAsync(IActivity item, string state, CancellationToken token)
        {
            var message = item as IMessageActivity;

            if (message != null)
            {
                string messageToSend = string.Empty;

                if (message.Text.ToLower() == "ayuda" || message.Text.ToLower() == "help")
                {
                    if (item.ChannelId == Channel.Skype)
                    {
                        messageToSend  = "Para conversar conmigo puedes hacerlo escribiendome o directamente llamarme.";
                        messageToSend += " \n\n\n\n" + "Escribeme frases de la siguiente manera";
                        messageToSend += " \n\n\n\n" + "-Enciende la luz de la habitación";
                        messageToSend += " \n\n\n\n" + "-Apagar luz de la cocina";
                        messageToSend += " \n\n\n\n" + "-Sube la persiana del comedor";
                    }

                    if (item.ChannelId == Channel.Sms)
                    {
                        messageToSend  = "Enviame mensajes como";
                        messageToSend += " \n\n" + "encender luz cocina";
                        messageToSend += " \n\n" + "apagar luz comedor";
                        messageToSend += " \n\n" + "subir persiana habitacion";
                    }


                    var commonResponsesDialog = new HelpDialog(messageToSend);
                    var interruption          = commonResponsesDialog.Void <object, IMessageActivity>();
                    this._task.Call(interruption, null);
                    await this._task.PollAsync(token);
                }
            }
        }
Пример #2
0
        protected override Task PostAsync(IActivity item, string state, CancellationToken token)
        {
            var message      = item as IMessageActivity;
            var dialog       = new HelpDialog();
            var interruption = dialog.Void(_stack);

            _stack.Call(interruption, null);
            return(Task.CompletedTask);
        }
Пример #3
0
        protected override async Task PostAsync(IActivity item, string state, CancellationToken token)
        {
            var message = item as IMessageActivity;

            if (message != null)
            {
                var settingsDialog = new HelpDialog();

                var interruption = settingsDialog.Void <object, IMessageActivity>();

                this.task.Call(interruption, null);

                await this.task.PollAsync(token);
            }
        }