Esempio n. 1
0
 public void PrerenderDefaultOutput(
     long chatId,
     TelegramBotClientFacade telegramBotClientFacade)
 {
     telegramBotClientFacade
     .SendButtonMessageToChat(chatId, GetButtons());
 }
Esempio n. 2
0
        public void ProcessInput(
            long chatId,
            string input,
            TelegramBotClientFacade telegramBotClientFacade,
            CurrentStateHolder stateHolder)
        {
            var selectedButton = GetButtons()
                                 .FirstOrDefault(p => input
                                                 .Equals(p, StringComparison.InvariantCultureIgnoreCase));

            if (selectedButton == null)
            {
                telegramBotClientFacade
                .SendButtonMessageToChat(chatId, GetButtons());
            }
            else
            {
                var nextState = ButtonToNextStateMapper(selectedButton);
                nextState.PrerenderDefaultOutput(chatId, telegramBotClientFacade);
                stateHolder.SetNextState(nextState);
            }
        }
Esempio n. 3
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);
            }
        }
Esempio n. 4
0
 public void PrerenderDefaultOutput(
     long chatId,
     TelegramBotClientFacade telegramBotClientFacade)
 {
     telegramBotClientFacade.SendButtonMessageToChat(chatId, GetAddressesByCity(_selectedCity));
 }