예제 #1
0
        public async Task ProgressTrackerCommand([Remainder] string TrackerArgs)
        {
            //TODO this all needs to be reworked for globalization
            string[]      splitArgs   = TrackerArgs.Split(' ');
            string        NameOfTrack = TrackerArgs;
            ChallengeRank difficulty  = ChallengeRank.None;

            if (Enum.TryParse(Enum.GetNames(typeof(ChallengeRank)).FirstOrDefault(cr => ProgressTracker.HasMatchingChallengeRank(cr, splitArgs)), out difficulty))
            {
                NameOfTrack = Regex.Replace(NameOfTrack, difficulty.ToString(), string.Empty, RegexOptions.IgnoreCase);
            }

            if (difficulty == ChallengeRank.None)
            {
                await CreateEmptyTracker(NameOfTrack);
            }
            else
            {
                await BuildProgressTrackerPostAsync(difficulty, NameOfTrack);
            }
        }