Пример #1
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);
            }
        }
Пример #2
0
 public void ProcessInput(long chatId,
                          string input,
                          TelegramBotClientFacade telegramBotClientFacade, CurrentStateHolder stateHolder)
 {
     stateHolder.SetNextState(new OnStartSelectState());
 }