Psycho Pass Command

This commit is contained in:
Dragon Fire
2018-08-04 11:31:50 -04:00
parent 45057e06a6
commit 9f91ee2404
4 changed files with 43 additions and 2 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 (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.
+5
View File
@@ -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."
}
+35
View File
@@ -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}`
);
}
};
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "85.10.4",
"version": "85.11.0",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {