Add days as option in timer command

+ Remove useless comments
This commit is contained in:
SileNce5k 2022-06-10 20:19:51 +02:00
parent 664598681f
commit 76da183b67
No known key found for this signature in database
GPG key ID: C507260E7F2583AD
2 changed files with 6 additions and 4 deletions

View file

@ -5,7 +5,7 @@ module.exports = {
description: "Set a timer for a time in minutes.",
moreHelp: ["Usage:"
,"`<prefix>timer <time_in_minutes> <message_to_send>`"
,"`<prefix>timer <time>(m|h|s) <message_to_send>`"
,"`<prefix>timer <time>(m|h|s|d) <message_to_send>`"
,"Bot will mention you after the time has passed, with the custom message."],
execute({client, message, args}) {
if(args.length < 2)

View file

@ -4,13 +4,15 @@ module.exports = function(time){
if(!isNaN(letter)) return parseFloat(time) * 60;
switch (letter.toUpperCase()) {
case "H":
timeInSeconds = timeInSeconds * 3600; // 3 600 000
timeInSeconds = timeInSeconds * 3600;
break;
case "M":
timeInSeconds = timeInSeconds * 60; // 60 000
timeInSeconds = timeInSeconds * 60;
break;
case "S":
timeInSeconds = timeInSeconds; // 1 000
break;
case "D":
timeInSeconds = timeInSeconds * 86400;
break;
default:
timeInSeconds = -1;