From 9c0f89b53e1783cf354602c67ffb51daa010e784 Mon Sep 17 00:00:00 2001 From: Daniel Odendahl Jr Date: Wed, 5 Sep 2018 23:51:02 +0000 Subject: [PATCH] IQ Command --- README.md | 3 ++- commands/analyze/iq.js | 28 ++++++++++++++++++++++++++++ package.json | 2 +- 3 files changed, 31 insertions(+), 2 deletions(-) create mode 100644 commands/analyze/iq.js diff --git a/README.md b/README.md index bf31ab7a..10f2319c 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 (299) +## Commands (300) ### Utility: * **eval**: Executes JavaScript code. @@ -180,6 +180,7 @@ on the [home server](https://discord.gg/sbMe32W). * **dick**: Determines your dick size. * **gender-analyze**: Determines the gender of a name. * **guess-looks**: Guesses what a user looks like. +* **iq**: Determines a user's IQ. * **psycho-pass**: Determines your Crime Coefficient. * **read-qr-code**: Reads a QR Code. * **severe-toxicity**: Determines the toxicity of text, but less sensitive to milder language. diff --git a/commands/analyze/iq.js b/commands/analyze/iq.js new file mode 100644 index 00000000..12491cde --- /dev/null +++ b/commands/analyze/iq.js @@ -0,0 +1,28 @@ +const Command = require('../../structures/Command'); +const Random = require('random-js'); + +module.exports = class IQCommand extends Command { + constructor(client) { + super(client, { + name: 'iq', + aliases: ['intelligence-quotient'], + group: 'analyze', + memberName: 'iq', + description: 'Determines a user\'s IQ.', + args: [ + { + key: 'user', + prompt: 'Which user do you want me to guess the IQ of?', + type: 'user', + default: msg => msg.author + } + ] + }); + } + + run(msg, { user }) { + const random = new Random(Random.engines.mt19937().seed(user.id)); + const score = random.integer(20, 170); + return msg.reply(`${user.id === msg.author.id ? 'Your' : `${user.username}'s`} IQ score is ${score}.`); + } +}; diff --git a/package.json b/package.json index fc765e06..0df3aa0a 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "90.1.1", + "version": "90.2.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {