mirror of
https://github.com/pragma-/pbot.git
synced 2025-01-11 12:32:37 +01:00
Improve error message for ParseDate
This commit is contained in:
parent
be80680626
commit
0697035284
@ -30,7 +30,8 @@ sub parsedate {
|
||||
my $parse = Time::ParseDate::parsedate($input, NOW => $now);
|
||||
|
||||
if (not defined $parse) {
|
||||
return (0, "I don't know what '$input' means.\n");
|
||||
$input =~ s/\s+$//;
|
||||
return (0, "I don't know what '$input' means. I expected a time duration like '5 minutes' or '24 hours' or 'next tuesday'.\n");
|
||||
} else {
|
||||
$seconds += $parse - $now;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user