diff --git a/README.md b/README.md index 9790de52..9f6f8ca3 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 (300) +## Commands (301) ### Utility: * **eval**: Executes JavaScript code. @@ -183,6 +183,7 @@ on the [home server](https://discord.gg/sbMe32W). * **face-analyze**: Determines the age, gender, and race of a face. * **gender-analyze**: Determines the gender of a name. * **guess-looks**: Guesses what a user looks like. +* **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. * **ship**: Ships two users together. diff --git a/assets/json/psycho-pass.json b/assets/json/psycho-pass.json new file mode 100644 index 00000000..a5e0bcd2 --- /dev/null +++ b/assets/json/psycho-pass.json @@ -0,0 +1,5 @@ +{ + "under100": "Suspect is not a target for enforcement action. The trigger of the Dominator will be locked.", + "between": "Suspect is classified as a latent criminal and is a target for enforcement action. Dominator is set to Non-Lethal Paralyzer mode.", + "over300": "Suspect poses a serious threat to society. Lethal force is authorized. The Dominator will automatically switch to Lethal Eliminator." +} diff --git a/commands/analyze/psycho-pass.js b/commands/analyze/psycho-pass.js new file mode 100644 index 00000000..fdfc48ee --- /dev/null +++ b/commands/analyze/psycho-pass.js @@ -0,0 +1,35 @@ +const Command = require('../../structures/Command'); +const Random = require('random-js'); +const { under100, between, over300 } = require('../../assets/json/psycho-pass'); + +module.exports = class PsychoPassCommand extends Command { + constructor(client) { + super(client, { + name: 'psycho-pass', + aliases: ['crime-coefficient'], + group: 'analyze', + memberName: 'psycho-pass', + description: 'Determines your Crime Coefficient.', + args: [ + { + key: 'user', + prompt: 'What user do you want to determine the Crime Coefficient of?', + type: 'user', + default: msg => msg.author + } + ] + }); + } + + run(msg, { user }) { + const random = new Random(Random.engines.mt19937().seed(user.id)); + const coefficient = random.integer(0, 500); + let res; + if (coefficient < 100) res = under100; + else if (coefficient > 300) res = over300; + else res = between; + return msg.reply( + `${msg.author.id === user.id ? 'Your' : `Suspect ${user.username}'s`} Crime Coefficient is ${coefficient}. ${res}` + ); + } +}; diff --git a/package.json b/package.json index 2ecc25d4..f03ff113 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xiao", - "version": "85.10.4", + "version": "85.11.0", "description": "Your personal server companion.", "main": "Xiao.js", "scripts": {