Add Abilities

This commit is contained in:
Dragon Fire
2020-12-03 10:35:46 -05:00
parent 51eeca7911
commit edd5fa79ee
4 changed files with 9 additions and 2 deletions
+1
View File
@@ -64,6 +64,7 @@
"sDef": 6,
"spd": 29
},
"abilities": ["N/A"],
"chain": [0],
"missingno": true,
"sprite": "https://cdn.bulbagarden.net/upload/9/98/Missingno_RB.png",
+2 -1
View File
@@ -103,7 +103,8 @@ module.exports = class PokedexCommand extends Command {
\`Sp. Attack: [${'█'.repeat(repeat.sAtk)}${' '.repeat(20 - repeat.sAtk)}]\` **${data.stats.sAtk}**
\`Sp. Defense: [${'█'.repeat(repeat.sDef)}${' '.repeat(20 - repeat.sDef)}]\` **${data.stats.sDef}**
\`Speed: [${'█'.repeat(repeat.spd)}${' '.repeat(20 - repeat.spd)}]\` **${data.stats.spd}**
`);
`)
.addField(' Abilities', data.abilities.join(' / '));
if (data.cry) {
const connection = msg.guild ? this.client.voice.connections.get(msg.guild.id) : null;
if (connection) {
+1 -1
View File
@@ -1,6 +1,6 @@
{
"name": "xiao",
"version": "123.2.1",
"version": "123.2.2",
"description": "Your personal server companion.",
"main": "Xiao.js",
"scripts": {
+5
View File
@@ -37,6 +37,7 @@ module.exports = class Pokemon {
data: data.missingno ? missingno.chain : data.evolution_chain ? [] : [data.id]
};
this.stats = data.missingno ? data.stats : null;
this.abilities = data.missingno ? data.abilities : null;
this.gameDataCached = data.missingno || false;
this.missingno = data.missingno || false;
this.cry = data.id > store.pokemonCountWithCry
@@ -92,6 +93,10 @@ module.exports = class Pokemon {
variety.display = true;
}
}
for (const ability of defaultBody.abilities) {
const { body } = await request.get(ability.ability.url);
this.abilities.push(body.names.find(name => name.language.name === 'en').name);
}
this.gameDataCached = true;
return this;
}