Files
xiao/commands/analyze/age.js
T
Daniel Odendahl Jr deac8d64b9 Fix
2018-10-25 11:03:33 +00:00

26 lines
596 B
JavaScript

const Command = require('../../structures/Command');
module.exports = class AgeCommand extends Command {
constructor(client) {
super(client, {
name: 'age',
group: 'analyze',
memberName: 'age',
description: 'Responds with how old someone born in a certain year is.',
args: [
{
key: 'year',
prompt: 'What year would you like to get the age for?',
type: 'integer',
min: 1
}
]
});
}
run(msg, { year }) {
const currentYear = new Date().getFullYear();
return msg.say(`Someone born in ${year} would be ${currentYear - year} years old.`);
}
};