From de167e58bce4c6b1a56553d654073fab63c667cb Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Thu, 12 Oct 2017 22:16:51 +0000 Subject: [PATCH] Guess looks Command --- commands/random-res/guess-my-looks.js | 47 +++++++++++++++++++++++++++ package.json | 2 +- 2 files changed, 48 insertions(+), 1 deletion(-) create mode 100644 commands/random-res/guess-my-looks.js diff --git a/commands/random-res/guess-my-looks.js b/commands/random-res/guess-my-looks.js new file mode 100644 index 00000000..cb5f9f06 --- /dev/null +++ b/commands/random-res/guess-my-looks.js @@ -0,0 +1,47 @@ +const { Command } = require('discord.js-commando'); +const { oneLine } = require('common-tags'); +const genders = ['male', 'female']; +const eyeColors = ['blue', 'brown', 'hazel', 'green']; +const hairColors = ['blonde', 'brown', 'red', 'black']; +const hairStyles = ['curly', 'straight', 'wavy']; +const hairLengths = ['long', 'shoulder-length', 'short', 'balding']; +const extras = ['freckles', 'glasses', 'dimples', 'contacts', 'loads of acne', 'pretty smile']; + +module.exports = class GuessMyLooksCommand extends Command { + constructor(client) { + super(client, { + name: 'guess-my-looks', + aliases: ['guess-looks'], + group: 'random-res', + memberName: 'guess-my-looks', + description: 'Guesses what you look like.', + args: [ + { + key: 'user', + prompt: 'Which user do you want me to guess the looks of?', + type: 'user', + default: '' + } + ] + }); + } + + run(msg, { user }) { + if (!user) user = msg.author; + const gender = genders[Math.floor(Math.random() * genders.length)]; + const eyeColor = eyeColors[Math.floor(Math.random() * eyeColors.length)]; + const hairColor = hairColors[Math.floor(Math.random() * hairColors.length)]; + const hairStyle = hairStyles[Math.floor(Math.random() * hairStyles.length)]; + const hairLength = hairLengths[Math.floor(Math.random() * hairLengths.length)]; + const age = Math.floor(Math.random() * (100 - 10 + 1)) + 10; + const feet = Math.floor(Math.random() * (7 - 3 + 1)) + 3; + const inches = Math.floor(Math.random() * 12); + const weight = Math.floor(Math.random() * (300 - 50 + 1)) + 50; + const extra = extras[Math.floor(Math.random() * extras.length)]; + const prefix = user.id === msg.author.id ? 'You' : 'They'; + return msg.reply(oneLine` + ${prefix} are, I think, a ${age} year old ${gender} with ${eyeColor} eyes and ${hairLength} ${hairStyle} + ${hairColor} hair. ${prefix} are ${feet}'${inches}" and weigh ${weight} pounds. Don't forget the ${extra}! + `); + } +}; diff --git a/package.json b/package.json index d37d6758..bbe78ae7 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiaobot", - "version": "47.1.0", + "version": "47.2.0", "description": "Your personal server companion.", "main": "Shard.js", "scripts": {