コード例 #1
0
ファイル: ICurrentState.cs プロジェクト: sb2rhan/MCConsultBot
        public void ProcessInput(
            long chatId,
            string input,
            TelegramBotClientFacade telegramBotClientFacade,
            CurrentStateHolder stateHolder)
        {
            var nextState = new OnStartSelectState();

            nextState.ProcessInput(chatId, input, telegramBotClientFacade, stateHolder);

            stateHolder.SetNextState(nextState);
        }
コード例 #2
0
        public void ProcessInput(
            long chatId,
            string input,
            TelegramBotClientFacade telegramBotClientFacade,
            CurrentStateHolder stateHolder)
        {
            telegramBotClientFacade.SendMapMessageToChat(chatId);

            var initialState = new OnStartSelectState();

            initialState.PrerenderDefaultOutput(chatId, telegramBotClientFacade);
            stateHolder.SetNextState(initialState);
        }
コード例 #3
0
ファイル: ICurrentState.cs プロジェクト: sb2rhan/MCConsultBot
        public void ProcessInput(long chatId,
                                 string input,
                                 TelegramBotClientFacade telegramBotClientFacade,
                                 CurrentStateHolder stateHolder)
        {
            var doctorName = input;
            var schedule   = GetSchedule(doctorName);

            telegramBotClientFacade.SendTextMessageToChat(chatId, schedule);

            var nextState = new OnStartSelectState();

            nextState.PrerenderDefaultOutput(chatId, telegramBotClientFacade);
            stateHolder.SetNextState(nextState);
        }
コード例 #4
0
        public void ProcessInput(
            long chatId,
            string input,
            TelegramBotClientFacade telegramBotClientFacade,
            CurrentStateHolder stateHolder)
        {
            var selectedCity = GetCities()
                               .FirstOrDefault(p => p.Equals(input, StringComparison.InvariantCultureIgnoreCase));

            if (selectedCity == null)
            {
                telegramBotClientFacade
                .SendTextMessageToChat(chatId, "Пожалуйста, повторите попытку");

                telegramBotClientFacade
                .SendButtonMessageToChat(chatId, GetCities());
            }
            else
            {
                var nextState = GetSelectAddressState(selectedCity);
                nextState.PrerenderDefaultOutput(chatId, telegramBotClientFacade);
                stateHolder.SetNextState(nextState);
            }
        }