Random support in pokemon-fusion

This commit is contained in:
Daniel Odendahl Jr
2018-10-24 20:59:44 +00:00
parent 9215229ed1
commit 66805aac8b
2 changed files with 4 additions and 1 deletions
+3
View File
@@ -1,6 +1,7 @@
const Command = require('../../structures/Command');
const pokemon = require('../../assets/json/pokemon-fusion');
const { firstUpperCase } = require('../../util/Util');
const pokeKeys = Object.keys(pokemon);
module.exports = class PokemonFusionCommand extends Command {
constructor(client) {
@@ -16,6 +17,7 @@ module.exports = class PokemonFusionCommand extends Command {
key: 'body',
prompt: 'What Pokémon should be fused as the body?',
type: 'string',
default: () => pokeKeys[Math.floor(Math.random() * pokeKeys.length)],
validate: body => {
if (pokemon[body.toLowerCase()]) return true;
return 'Invalid body, only Pokémon from Generation I may be used.';
@@ -26,6 +28,7 @@ module.exports = class PokemonFusionCommand extends Command {
key: 'palette',
prompt: 'What Pokémon should be fused as the palette?',
type: 'string',
default: () => pokeKeys[Math.floor(Math.random() * pokeKeys.length)],
validate: palette => {
if (pokemon[palette.toLowerCase()]) return true;
return 'Invalid palette, only Pokémon from Generation I may be used.';
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "95.1.9",
"version": "95.1.10",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {