1
0
mirror of https://gitlab.com/Deukhoofd/DeukBot4.git synced 2025-10-27 17:00:05 +00:00

Allow for floats in timespan pattern matching

This commit is contained in:
2018-05-06 18:54:06 +02:00
parent f0b66f6415
commit b4d795f843
2 changed files with 2 additions and 2 deletions

View File

@@ -49,7 +49,7 @@ namespace DeukBot4.MessageHandlers.CommandHandler.RequestStructure
case ParameterType.User:
return $" *(?:<@(?<{index}>\\d+)>|(?<{index}>\\d+)(?:$| |\n))";
case ParameterType.Timespan:
return $" *(?<{index}>\\d+[smhd])";
return $" *(?<{index}>\\d+.*d*[smhd])";
default:
throw new ArgumentOutOfRangeException(nameof(type), type, null);
}

View File

@@ -9,7 +9,7 @@ namespace DeukBot4.Utilities
{
var timeIndicator = s.Last();
var numberStr = s.Remove(s.Length - 1, 1);
if (!int.TryParse(numberStr, out var number))
if (!float.TryParse(numberStr, out var number))
{
return null;
}