chaned time and days

- days to day(s)
- months to month(s) etc
This commit is contained in:
samvaio 2016-11-22 01:24:53 +05:30 committed by GitHub
parent aa8d67a1db
commit b6811afb34

View File

@ -151,11 +151,11 @@ namespace NadekoBot.Modules.Utility
continue; continue;
} }
else if (value < 1 || else if (value < 1 ||
(groupName == "months" && value > 1) || (groupName == "month(s)" && value > 1) ||
(groupName == "weeks" && value > 4) || (groupName == "week(s)" && value > 4) ||
(groupName == "days" && value >= 7) || (groupName == "day(s)" && value >= 7) ||
(groupName == "hours" && value > 23) || (groupName == "hour(s)" && value > 23) ||
(groupName == "minutes" && value > 59)) (groupName == "minute(s)" && value > 59))
{ {
await channel.SendMessageAsync($"⚠️ Invalid {groupName} value.").ConfigureAwait(false); await channel.SendMessageAsync($"⚠️ Invalid {groupName} value.").ConfigureAwait(false);
return; return;
@ -164,11 +164,11 @@ namespace NadekoBot.Modules.Utility
namesAndValues[groupName] = value; namesAndValues[groupName] = value;
output += m.Groups[groupName].Value + " " + groupName + " "; output += m.Groups[groupName].Value + " " + groupName + " ";
} }
var time = DateTime.Now + new TimeSpan(30 * namesAndValues["months"] + var time = DateTime.Now + new TimeSpan(30 * namesAndValues["month(s)"] +
7 * namesAndValues["weeks"] + 7 * namesAndValues["week(s)"] +
namesAndValues["days"], namesAndValues["day(s)"],
namesAndValues["hours"], namesAndValues["hour(s)"],
namesAndValues["minutes"], namesAndValues["minute(s)"],
0); 0);
var rem = new Reminder var rem = new Reminder