From 5f4a0056d7231b97475ca28685d2c882808f916d Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Sun, 15 May 2022 01:27:40 +0200 Subject: [PATCH] Fix thing when first arg is NaN --- commands/misc/timer.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/commands/misc/timer.js b/commands/misc/timer.js index 59e03f7..c4764f1 100644 --- a/commands/misc/timer.js +++ b/commands/misc/timer.js @@ -5,7 +5,10 @@ module.exports = { execute({message, args}) { if(args.length < 2) return message.channel.send("Please specify a time in minutes, and a message to send after the timer has finished"); - let time = args[0] * 60000; + let time = parseInt(args[0]); + if(isNaN(time)) + return message.channel.send("Specify a time in number of minutes"); + time = time * 60000; let sendText = args.slice(1).join(" "); setTimeout(function(){ message.channel.send(`<@${message.author.id}>, ${sendText}`);