public BotBrains(string requestHost) { var accId = _regService.AccountIdByHost(requestHost); if (accId != null) { AccountId = accId.Value; var account = _regService.FindAccount(AccountId); if (account != null) { _service = ServiceCreator.GetCustomerService(account.Login); } else { throw new ConfigurationException("Аккаунт в системе не найден!"); } } else { throw new ConfigurationException("Бот в системе не зарегистрирован!"); } }