protected async override void CheckForChange_Elapsed(object stateinfo) { try { var newResults = await fetchUser(); if (PreviousResults.count.win != newResults.count.win || PreviousResults.count.loss != newResults.count.loss) { var game = await fetchGamePGN(); var embed = await createGameEmbed(game.pgn, game.moves); PreviousResults = newResults; foreach (var channel in ChannelConfig.Keys) { await OnMajorChangeTracked(channel, embed, (string)ChannelConfig[channel]["Notification"]); } await UpdateTracker(); } } catch (Exception e) { await Program.MopsLog(new LogMessage(LogSeverity.Verbose, "", $"Found no videos by {Name}")); } }
public LichessTracker(string name) : base() { Name = name; //Check if person exists by forcing Exceptions if not. try { PreviousResults = fetchUser().Result; var test = PreviousResults.username; SetTimer(); } catch (Exception e) { Dispose(); throw new Exception($"Channel {TrackerUrl()} could not be found on Youtube!\nPerhaps you used the channel-name instead?", e); } }