Files
xiao/commands/analyze/birthstone.js
T
2024-03-30 00:30:52 -04:00

28 lines
820 B
JavaScript

const Command = require('../../framework/Command');
const { list, firstUpperCase } = require('../../util/Util');
const { months } = require('../../assets/json/month');
const stones = require('../../assets/json/birthstone');
module.exports = class BirthstoneCommand extends Command {
constructor(client) {
super(client, {
name: 'birthstone',
group: 'analyze',
memberName: 'birthstone',
description: 'Responds with the Birthstone for a month.',
args: [
{
key: 'month',
type: 'month'
}
]
});
}
run(msg, { month }) {
const stone = stones[month - 1];
const alternate = stone.alternate ? ` Alternatively, you can also use ${list(stone.alternate, 'or')}.` : '';
return msg.say(`The Birthstone for ${firstUpperCase(months[month - 1])} is ${stone.primary}.${alternate}`);
}
};