Butt command, improve scrabble score

This commit is contained in:
Daniel Odendahl Jr
2018-09-05 15:04:56 +00:00
parent 1ee36ef8eb
commit 3d76d81e48
6 changed files with 64 additions and 9 deletions
+2 -1
View File
@@ -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.
+27
View File
@@ -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"
]
+1 -2
View File
@@ -24,6 +24,5 @@
"w": 4,
"x": 8,
"y": 4,
"z": 10,
" ": 0
"z": 10
}
+29
View File
@@ -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]}`);
}
};
+4 -5
View File
@@ -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);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "90.0.7",
"version": "90.1.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {