mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Is Leap Year Command
This commit is contained in:
@@ -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.`);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user