Allow dates to be used in timer command
All checks were successful
CI / CI (push) Successful in 1m23s

This commit is contained in:
SileNce5k 2025-05-14 06:51:03 +02:00
parent c74f323c1b
commit 2c90c20e50
Signed by: SileNce
GPG key ID: B0A142BB4291B204
4 changed files with 40 additions and 21 deletions

View file

@ -8,7 +8,7 @@ module.exports = {
moreHelp: ["Usage:"
,"`<prefix>timer [add|create] <time_in_minutes> <message_to_send>`"
,"`<prefix>timer <time>(d|h|m|s|t) <message_to_send>`"
,"`<prefix>timer <time_in_minutes> <message_to_send>`"
,"`<prefix>timer <future_date> <message_to_send>`"
,"`<prefix>timer edit <timer_id> <new_time_in_minutes> <new_message_to_send>` (not implemented)"
,"`<prefix>timer [delete|remove] <timer_id>`"
,"`<prefix>timer show <timer_id>`"
@ -18,7 +18,8 @@ module.exports = {
switch (args[0]) {
case "add":
case "create":
sendText = await createTimer(message, args, false);
args.shift()
sendText = await createTimer(message, args);
break;
case "edit":
sendText = "not implemented yet"
@ -38,7 +39,7 @@ module.exports = {
break;
}
if(!isNaN(parseTime(args[0], Math.floor(new Date() / 1000))))
sendText = await createTimer(message, args, true);
sendText = await createTimer(message, args);
break;
}
message.channel.send(sendText);