public RegisterGardensController(IGardenService gardenServices, ICountyService countyService, IGardenTypeService gardenTypeService, IGardenSizeService gardenSizeService, IGardenReasonService gardenReasonService, IPlantTypeService plantTypeService) { GardenServices = gardenServices; CountyService = countyService; GardenTypeService = gardenTypeService; GardenSizeService = gardenSizeService; GardenReasonService = gardenReasonService; PlantTypeService = plantTypeService; }
public TelegramBotService(string botKey, IGardenService gardenService, ILogger <TelegramBotService> logger, IPowerService powerService) { _logger = logger; _powerService = powerService; _currentBot = new TelegramBotClient(botKey); _currentBot.OnMessage += BotOnMessageReceived; _currentBot.OnMessageEdited += BotOnMessageReceived; _gardenService = gardenService; _gardenService.SubscribeOnStart(_gardenOnStartHandler); _gardenService.SubscribeOnStop(_gardenOnStopHandler); _powerService.SubscribeOnValueAcquired(_powerValueAcquiredHandler); User currentBotInfo = _currentBot.GetMeAsync().GetAwaiter().GetResult(); _logger.LogDebug($"Connected as: {currentBotInfo.Username}"); }