public MessageListener(ConfigurationService configurationService, ButtcoinService buttcoinService, TwitchApi twitchApi) { _configurationService = configurationService; _buttcoinService = buttcoinService; _twitchApi = twitchApi; _random = new Random(); _liveChannels = twitchApi.IsTargetsLive().Result; var isLiveTimer = new Timer(); isLiveTimer.Elapsed += async(sender, args) => { _liveChannels = await twitchApi.IsTargetsLive(); }; isLiveTimer.Interval = TimeSpan.FromMinutes(5).TotalMilliseconds; isLiveTimer.Enabled = true; }