From f7882fe4a88932e1c3529d1facd465792985bf3a Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sat, 28 Nov 2020 15:41:09 -0500 Subject: [PATCH] Make age more accurate for future years --- commands/analyze/age.js | 4 +++- package.json | 2 +- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/commands/analyze/age.js b/commands/analyze/age.js index 5d186b79..8499672d 100644 --- a/commands/analyze/age.js +++ b/commands/analyze/age.js @@ -20,6 +20,8 @@ module.exports = class AgeCommand extends Command { run(msg, { year }) { const currentYear = new Date().getFullYear(); - return msg.say(`Someone born in ${year} would be ${currentYear - year} years old.`); + const age = currentYear - year; + if (age < 0) return msg.say(`Someone born in ${year} will be born in ${Math.abs(age)} years.`); + return msg.say(`Someone born in ${year} would be ${age} years old.`); } }; diff --git a/package.json b/package.json index 7109f2ac..a8602e11 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "122.0.0", + "version": "122.0.1", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {