mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
25 lines
538 B
JavaScript
25 lines
538 B
JavaScript
const Command = require('../../framework/Command');
|
|
const { shuffle } = require('../../util/Util');
|
|
|
|
module.exports = class RankCommand extends Command {
|
|
constructor(client) {
|
|
super(client, {
|
|
name: 'rank',
|
|
group: 'random-res',
|
|
description: 'Ranks the options you provide.',
|
|
args: [
|
|
{
|
|
key: 'choices',
|
|
type: 'string',
|
|
infinite: true,
|
|
max: 150
|
|
}
|
|
]
|
|
});
|
|
}
|
|
|
|
run(msg, { choices }) {
|
|
return msg.say(shuffle(choices).map((choice, i) => `**${i + 1}.** ${choice}`).slice(0, 10).join('\n'));
|
|
}
|
|
};
|