Skip to content
This repository has been archived by the owner on Jun 30, 2023. It is now read-only.

Commit

Permalink
Throw exception on TimeSpan parse failure
Browse files Browse the repository at this point in the history
Forces command overloads which accept optional TimeSpan to be considered, instead of resolving to string with RemainingTextAttribute
  • Loading branch information
oliverbooth committed Mar 28, 2022
1 parent d2445b1 commit 6d74b97
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions BrackeysBot/ArgumentConverters/TimeSpanArgumentConverter.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@ public Task<Optional<TimeSpan>> ConvertAsync(string value, CommandContext ctx)
result += TimeSpan.FromSeconds(unitValue);
unitValue = 0;
break;

default:
// force DisCatSharp to consider another overload
throw new FormatException();
}
}

Expand Down

0 comments on commit 6d74b97

Please sign in to comment.