Beispiel #1
0
        public void StartCommand(BotCommandName commandName)
        {
            switch (commandName)
            {
            case BotCommandName.StartCommand: throw new InvalidOperationException();

            case BotCommandName.ScheduleAdd: StartScheduleAddCommand(); break;

            case BotCommandName.TaskAdd: StartTaskAddCommand(); break;

            case BotCommandName.TaskComplete: StartTaskCompleteCommand(); break;

            default: throw new InvalidOperationException();
            }
        }
Beispiel #2
0
        protected void ResponseAskYesNo(String title, BotCommandName commandName, String methodName)
        {
            var tp = new ButtonTemplateMessage();

            tp.RecipientID = this.RecipientID;
            tp.Text        = title;
            {
                var bt = new PostbackButton();
                bt.Title = this.Text(TextKey.Confirm_Yes);
                bt.SetPayload(commandName, methodName, "True");
                tp.Buttons.Add(bt);
            }
            {
                var bt = new PostbackButton();
                bt.Title = this.Text(TextKey.Confirm_No);
                bt.SetPayload(commandName, methodName, "False");
                tp.Buttons.Add(bt);
            }
            var cl = new FacebookBotClient();

            cl.SendMessage(tp);
        }