From 61b38829292a1cee2fefc3b59e6f636bec7b585e Mon Sep 17 00:00:00 2001 From: ericmck2000 Date: Wed, 22 Aug 2018 15:17:45 -0500 Subject: [PATCH] Removed my "Timespanext" class. In my current code base, I created a "Wrapper" class to trick the command parser into using a custom type reader, instead of the built-in timespan parser. I forgot to remove those pieces for the initial edit. --- src/Discord.Net.Commands/Readers/TimeSpanTypeReader.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/Discord.Net.Commands/Readers/TimeSpanTypeReader.cs b/src/Discord.Net.Commands/Readers/TimeSpanTypeReader.cs index 292427a76..6a7ed5673 100644 --- a/src/Discord.Net.Commands/Readers/TimeSpanTypeReader.cs +++ b/src/Discord.Net.Commands/Readers/TimeSpanTypeReader.cs @@ -33,10 +33,10 @@ namespace Discord.Commands //First, try using the built-in TimeSpan.Parse. (Default Implementation) if (TimeSpan.TryParseExact(data, _formats, CultureInfo.InvariantCulture, out TimeSpan timeSpan)) - return Task.FromResult(TypeReaderResult.FromSuccess(new TimeSpanext(timeSpan))); - //@XtremeOwnage - Try using the regular TimeSpan.TryPrase + return Task.FromResult(TypeReaderResult.FromSuccess(timeSpan)); + //@ericmck2000 - Try using the regular TimeSpan.TryPrase. Greatly improves success rate. else if (TimeSpan.TryParse(data, out TimeSpan Time)) - return Task.FromResult(TypeReaderResult.FromSuccess(new TimeSpanext(Time))); + return Task.FromResult(TypeReaderResult.FromSuccess(Time)); else { return Task.FromResult(TypeReaderResult.FromError(CommandError.ParseFailed, "Failed to parse TimeSpan"));