mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-15 08:22:37 +02:00
35 lines
1.1 KiB
JavaScript
35 lines
1.1 KiB
JavaScript
const Command = require('../../structures/Command');
|
|
const { stripIndents } = require('common-tags');
|
|
const { formatTime } = require('../../util/Util');
|
|
const horses = require('../../assets/json/horse-race');
|
|
|
|
module.exports = class HorseInfoCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'horse-info',
|
|
aliases: ['horse'],
|
|
group: 'games-sp',
|
|
memberName: 'horse-info',
|
|
description: 'Responds with detailed information on a horse.',
|
|
args: [
|
|
{
|
|
key: 'horse',
|
|
prompt: 'Which horse would you like to get information on?',
|
|
type: 'string',
|
|
validate: horse => horses.some(h => h.name.toLowerCase() === horse.toLowerCase()),
|
|
parse: horse => horses.find(h => h.name.toLowerCase() === horse.toLowerCase())
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { horse }) {
|
|
return msg.say(stripIndents`
|
|
__**Information on ${horse.name}**__
|
|
**Name:** ${horse.name}
|
|
**Fastest Recorded Time:** ${formatTime(horse.minTime)}
|
|
**Name Origin:** ${horse.origin || 'None'}
|
|
`);
|
|
}
|
|
};
|