From 6003d568ac10166c455ee201aa4530eab611e6d5 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 21 Sep 2017 22:53:30 +0000 Subject: [PATCH] Beep --- commands/random/days-until.js | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/commands/random/days-until.js b/commands/random/days-until.js index 9edf8882..a0d9bdaa 100644 --- a/commands/random/days-until.js +++ b/commands/random/days-until.js @@ -22,7 +22,8 @@ module.exports = class DaysUntilCommand extends Command { run(msg, { date }) { const month = parseInt(date[0], 10); - const day = date[1] ? parseInt(date[1], 10) : NaN; + const day = parseInt(date[1], 10); + if (!month || !day) return msg.say('There are N/A days until Invalid Date!'); const now = new Date(); let year = now.getMonth() + 1 <= month ? now.getFullYear() : now.getFullYear() + 1; if (month === now.getMonth() + 1 && now.getDate() >= day) ++year;