From 80b813ad1469c1e7f783bbac4cd293224db0ed09 Mon Sep 17 00:00:00 2001 From: SileNce5k Date: Thu, 29 Jun 2023 16:57:39 +0200 Subject: [PATCH] Fix bot crashing when no message is provided closes #59 --- commands/misc/timer.js | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/commands/misc/timer.js b/commands/misc/timer.js index 89c7a5c..8f9e0df 100644 --- a/commands/misc/timer.js +++ b/commands/misc/timer.js @@ -32,7 +32,11 @@ module.exports = { sendText = await showTimer(message.author.id, args[1]); break; default: - sendText = "not sure what you mean" + sendText = "not sure what you mean"; + if(args.length < 2){ + sendText = "Please specify a time, and a message to send after the timer has finished"; + break; + } if(!isNaN(parseTime(args[0], Math.floor(new Date() / 1000)))) sendText = await createTimer(message, args, true); console.log("sendText: ", sendText)