From 3d76d81e48ff49ec011d987c1c95645a2b308a08 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 5 Sep 2018 15:04:56 +0000 Subject: [PATCH] Butt command, improve scrabble score --- README.md | 3 ++- assets/json/butt.json | 27 ++++++++++++++++++++++++ assets/json/scrabble-score.json | 3 +-- commands/analyze/butt.js | 29 ++++++++++++++++++++++++++ commands/number-edit/scrabble-score.js | 9 ++++---- package.json | 2 +- 6 files changed, 64 insertions(+), 9 deletions(-) create mode 100644 assets/json/butt.json create mode 100644 commands/analyze/butt.js diff --git a/README.md b/README.md index 75d193ca..bf31ab7a 100644 --- a/README.md +++ b/README.md @@ -15,7 +15,7 @@ Xiao is a Discord bot coded in JavaScript with The bot is no longer available for invite. You can self-host the bot, or use her on the [home server](https://discord.gg/sbMe32W). -## Commands (298) +## Commands (299) ### Utility: * **eval**: Executes JavaScript code. @@ -175,6 +175,7 @@ on the [home server](https://discord.gg/sbMe32W). ### Analyzers: +* **butt**: Determines a user's butt quality. * **coolness**: Determines a user's coolness. * **dick**: Determines your dick size. * **gender-analyze**: Determines the gender of a name. diff --git a/assets/json/butt.json b/assets/json/butt.json new file mode 100644 index 00000000..c90b9a01 --- /dev/null +++ b/assets/json/butt.json @@ -0,0 +1,27 @@ +[ + "average at best", + "pretty ok", + "decent", + "solid", + "flat af", + "meh", + "out of this world bby :)", + "tiny", + "terrible", + "nice ;)", + "god-awful", + "utterly unremarkable", + "of exceptional quality", + "incredible", + "nice and smooth", + "just so round... and out there...", + "unbelievable", + "so ugly only ur momma could love it", + "bootylicious", + "appalling", + "heave-inducing", + "unrepentantly uninteresting", + "garbage-tier", + "wretched", + "regal" +] diff --git a/assets/json/scrabble-score.json b/assets/json/scrabble-score.json index 5565490a..40899aff 100644 --- a/assets/json/scrabble-score.json +++ b/assets/json/scrabble-score.json @@ -24,6 +24,5 @@ "w": 4, "x": 8, "y": 4, - "z": 10, - " ": 0 + "z": 10 } diff --git a/commands/analyze/butt.js b/commands/analyze/butt.js new file mode 100644 index 00000000..99219872 --- /dev/null +++ b/commands/analyze/butt.js @@ -0,0 +1,29 @@ +const Command = require('../../structures/Command'); +const Random = require('random-js'); +const texts = require('../../assets/json/butt'); + +module.exports = class ButtCommand extends Command { + constructor(client) { + super(client, { + name: 'butt', + aliases: ['butts', 'ass', 'booty'], + group: 'analyze', + memberName: 'butt', + description: 'Determines a user\'s butt quality.', + args: [ + { + key: 'user', + prompt: 'Which user do you want to determine the butt quality of?', + type: 'user', + default: msg => msg.author + } + ] + }); + } + + run(msg, { user }) { + const random = new Random(Random.engines.mt19937().seed(user.id)); + const quality = random.integer(0, texts.length - 1); + return msg.reply(`${user.id === msg.author.id ? 'ur' : `${user.username}'s`} butt is ${texts[quality]}`); + } +}; diff --git a/commands/number-edit/scrabble-score.js b/commands/number-edit/scrabble-score.js index 5e267167..78a4a4ae 100644 --- a/commands/number-edit/scrabble-score.js +++ b/commands/number-edit/scrabble-score.js @@ -14,10 +14,6 @@ module.exports = class ScrabbleScoreCommand extends Command { key: 'word', prompt: 'What word would you like to get the scrabble score of?', type: 'string', - validate: word => { - if (/^[A-Za-z ]+$/i.test(word.toLowerCase())) return true; - return 'Invalid word, please only use A-Z and space.'; - }, parse: word => word.toLowerCase() } ] @@ -26,7 +22,10 @@ module.exports = class ScrabbleScoreCommand extends Command { run(msg, { word }) { let score = 0; - for (const letter of word.split('')) score += letters[letter]; + for (const letter of word.split('')) { + if (!letters[letter]) continue; + score += letters[letter]; + } return msg.reply(score); } }; diff --git a/package.json b/package.json index 4bf1dd75..8a4b6e5f 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "90.0.7", + "version": "90.1.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {