mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
26 lines
590 B
JavaScript
26 lines
590 B
JavaScript
const Command = require('../../framework/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',
|
|
description: 'Responds with if a year is a leap year.',
|
|
args: [
|
|
{
|
|
key: 'year',
|
|
type: 'integer',
|
|
default: () => new Date().getFullYear(),
|
|
min: 1
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { year }) {
|
|
return msg.say(`${year} **${isLeap(year) ? 'is' : 'is not'}** a leap year.`);
|
|
}
|
|
};
|