Exemplo n.º 1
0
 public void Poll()
 {
     _Challenges.StartPoll(new ChallengePollOptions()
     {
         Possible = new List <int>()
         {
             1, 2
         },
         VoteTime = 120
     });
 }
Exemplo n.º 2
0
        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);
        }