mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-26 14:19:11 +02:00
Add names to pokemon-fusion
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
const Command = require('../../structures/Command');
|
const Command = require('../../structures/Command');
|
||||||
const pokemon = require('../../assets/json/pokemon-fusion');
|
const pokemon = require('../../assets/json/pokemon-fusion');
|
||||||
|
const { firstUpperCase } = require('../../util/Util');
|
||||||
|
|
||||||
module.exports = class PokemonFusionCommand extends Command {
|
module.exports = class PokemonFusionCommand extends Command {
|
||||||
constructor(client) {
|
constructor(client) {
|
||||||
@@ -19,7 +20,7 @@ module.exports = class PokemonFusionCommand extends Command {
|
|||||||
if (pokemon[body.toLowerCase()]) return true;
|
if (pokemon[body.toLowerCase()]) return true;
|
||||||
return 'Invalid body, only Pokémon from Generation I may be used.';
|
return 'Invalid body, only Pokémon from Generation I may be used.';
|
||||||
},
|
},
|
||||||
parse: body => pokemon[body.toLowerCase()]
|
parse: body => body.toLowerCase()
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
key: 'palette',
|
key: 'palette',
|
||||||
@@ -29,13 +30,17 @@ module.exports = class PokemonFusionCommand extends Command {
|
|||||||
if (pokemon[palette.toLowerCase()]) return true;
|
if (pokemon[palette.toLowerCase()]) return true;
|
||||||
return 'Invalid palette, only Pokémon from Generation I may be used.';
|
return 'Invalid palette, only Pokémon from Generation I may be used.';
|
||||||
},
|
},
|
||||||
parse: palette => pokemon[palette.toLowerCase()]
|
parse: palette => palette.toLowerCase()
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
run(msg, { body, palette }) {
|
run(msg, { body, palette }) {
|
||||||
return msg.say({ files: [`http://images.alexonsager.net/pokemon/fused/${body}/${body}.${palette}.png`] });
|
const prefix = body.slice(0, Math.round(body.length / 2));
|
||||||
|
const suffix = palette.slice(Math.round(palette.length / 2), palette.length);
|
||||||
|
return msg.say(firstUpperCase(`${prefix}${suffix}`), {
|
||||||
|
files: [`http://images.alexonsager.net/pokemon/fused/${pokemon[body]}/${pokemon[body]}.${pokemon[palette]}.png`]
|
||||||
|
});
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "xiao",
|
"name": "xiao",
|
||||||
"version": "95.1.1",
|
"version": "95.1.2",
|
||||||
"description": "Your personal server companion.",
|
"description": "Your personal server companion.",
|
||||||
"main": "Xiao.js",
|
"main": "Xiao.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
|||||||
Reference in New Issue
Block a user