private void StartAutoChallenge() { if (_AutoSettings.OptionCount <= 0) { _Logger.LogWarning($"Cannot start auto poll, there are 0 options"); return; } List <IRunChallenge> challenges = _Challenges.GetActive().Shuffle(); if (_AutoSettings.OptionCount > challenges.Count) { _Logger.LogWarning($"Setting auto challenge option count to {challenges.Count}, was {_AutoSettings.OptionCount}, which is more than options available"); _AutoSettings.OptionCount = challenges.Count; } ChallengePollOptions options = new ChallengePollOptions() { Possible = challenges.Take(_AutoSettings.OptionCount).Select(i => i.ID).ToList(), VoteTime = _AutoSettings.PollTime }; _Challenges.StartPoll(options); }
public void Active() { List <IRunChallenge> challs = _Challenges.GetActive(); _Logger.LogInformation($"Active challenges:\n{String.Join("\n", challs.Select(iter => $"\t{iter.ID}/{iter.Name}: {iter.Description}"))}"); }