public void PrerenderDefaultOutput( long chatId, TelegramBotClientFacade telegramBotClientFacade) { telegramBotClientFacade .SendButtonMessageToChat(chatId, GetButtons()); }
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); } }
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); } }
public void PrerenderDefaultOutput( long chatId, TelegramBotClientFacade telegramBotClientFacade) { telegramBotClientFacade.SendButtonMessageToChat(chatId, GetAddressesByCity(_selectedCity)); }