mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Make age more accurate for future years
This commit is contained in:
@@ -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.`);
|
||||
}
|
||||
};
|
||||
|
||||
+1
-1
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "xiao",
|
||||
"version": "122.0.0",
|
||||
"version": "122.0.1",
|
||||
"description": "Your personal server companion.",
|
||||
"main": "Xiao.js",
|
||||
"scripts": {
|
||||
|
||||
Reference in New Issue
Block a user