Is Leap Year Command

This commit is contained in:
Dragon Fire
2021-05-22 11:35:26 -04:00
parent 1f6acc7425
commit e174e9a464
+27
View File
@@ -0,0 +1,27 @@
const Command = require('../../structures/Command');
const { isLeap } = require('../../util/Util');
module.exports = class IsLeapCommand extends Command {
constructor(client) {
super(client, {
name: 'is-leap',
aliases: ['is-leap-year', 'leap-year', 'leap'],
group: 'events',
memberName: 'is-leap',
description: 'Responds with if a year is a leap year.',
args: [
{
key: 'year',
prompt: 'What year would you like to get data for?',
type: 'integer',
default: () => new Date().getFullYear(),
min: 1
}
]
});
}
run(msg, { year }) {
return msg.say(`${year} **${isLeap(year) ? 'is' : 'is not'}** a leap year.`);
}
};