From 142941d5346b195133d3c942eda7709f2719ec23 Mon Sep 17 00:00:00 2001 From: Dragon Fire Date: Sun, 24 May 2020 00:29:42 -0400 Subject: [PATCH] Rank Command --- README.md | 3 ++- commands/random-res/rank.js | 26 ++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 29 insertions(+), 2 deletions(-) create mode 100644 commands/random-res/rank.js diff --git a/README.md b/README.md index f82c8aa9..07f9d252 100644 --- a/README.md +++ b/README.md @@ -224,7 +224,7 @@ in the appropriate channel's topic to use it. ## Commands -Total: 442 +Total: 443 ### Utility: @@ -290,6 +290,7 @@ Total: 442 * **quantum-coin:** Flips a coin that lands on some form of nothing. * **quote:** Responds with a random quote. * **random-user:** Randomly chooses a member of the server. +* **rank:** Ranks the options you provide. * **rate:** Rates something. * **roast:** Roasts a user. * **roll:** Rolls a dice with a minimum/maximum value of your choice. diff --git a/commands/random-res/rank.js b/commands/random-res/rank.js new file mode 100644 index 00000000..dd3cf1e5 --- /dev/null +++ b/commands/random-res/rank.js @@ -0,0 +1,26 @@ +const Command = require('../../structures/Command'); +const { shuffle } = require('../../util/Util'); + +module.exports = class RankCommand extends Command { + constructor(client) { + super(client, { + name: 'rank', + group: 'random-res', + memberName: 'rank', + description: 'Ranks the options you provide.', + args: [ + { + key: 'choices', + prompt: 'What choices do you want me rank?', + type: 'string', + infinite: true, + max: 1950 + } + ] + }); + } + + run(msg, { choices }) { + return msg.say(shuffle(choices).map((choice, i) => `**${i + 1}.** ${choice}`).join('\n')); + } +}; diff --git a/package.json b/package.json index 55bcc868..0005ef01 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "114.27.1", + "version": "114.28.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {