mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-23 10:02:05 +02:00
Tabs
This commit is contained in:
@@ -15,24 +15,24 @@ module.exports = class HorseInfoCommand extends Command {
|
|||||||
{
|
{
|
||||||
key: 'horse',
|
key: 'horse',
|
||||||
prompt: 'Which horse would you like to get information on?',
|
prompt: 'Which horse would you like to get information on?',
|
||||||
type: 'string',
|
type: 'string',
|
||||||
validate: horse => {
|
validate: horse => {
|
||||||
const valid = horses.filter(h => h.name.toLowerCase().includes(horse.toLowerCase()));
|
const valid = horses.filter(h => h.name.toLowerCase().includes(horse.toLowerCase()));
|
||||||
if (valid.length > 1) return 'Multiple horses found. Please be more specific.';
|
if (valid.length > 1) return 'Multiple horses found. Please be more specific.';
|
||||||
return Boolean(valid.length);
|
return Boolean(valid.length);
|
||||||
},
|
},
|
||||||
parse: horse => horses.find(h => h.name.toLowerCase().includes(horse.toLowerCase()))
|
parse: horse => horses.find(h => h.name.toLowerCase().includes(horse.toLowerCase()))
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { horse }) {
|
run(msg, { horse }) {
|
||||||
return msg.say(stripIndents`
|
return msg.say(stripIndents`
|
||||||
__**Information on ${horse.name}**__
|
__**Information on ${horse.name}**__
|
||||||
**Name:** ${horse.name}
|
**Name:** ${horse.name}
|
||||||
**Fastest Recorded Time:** ${formatTime(horse.minTime)}
|
**Fastest Recorded Time:** ${formatTime(horse.minTime)}
|
||||||
**Name Origin:** ${horse.origin || 'None'}
|
**Name Origin:** ${horse.origin || 'None'}
|
||||||
`);
|
`);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user