This commit is contained in:
Dragon Fire
2021-01-20 18:05:18 -05:00
parent 1dca3ae20b
commit 4659409f06
3 changed files with 11 additions and 3 deletions
+7 -2
View File
@@ -2,6 +2,11 @@ const Command = require('../../structures/Command');
const { MessageEmbed } = require('discord.js');
const { stripIndents } = require('common-tags');
const { list } = require('../../util/Util');
const games = {
rb: 'Red/Blue',
sm: 'Sun/Moon',
ss: 'Sword/Shield'
};
module.exports = class PokedexCommand extends Command {
constructor(client) {
@@ -54,7 +59,7 @@ module.exports = class PokedexCommand extends Command {
const data = await this.client.pokemon.fetch(pokemon);
if (!data) return msg.say('Could not find any results.');
if (!data.gameDataCached) await data.fetchGameData();
const game = data.id > 807 ? 'ss' : 'sm';
const game = data.missingno ? 'rb' : data.id > 807 ? 'ss' : 'sm';
if (!data.smogonTiers[game]) await data.fetchSmogonTiers(game);
const displayForms = data.varieties.filter(vrity => vrity.statsDiffer);
const variety = displayForms.find(vrity => {
@@ -91,7 +96,7 @@ module.exports = class PokedexCommand extends Command {
\`Total: [${'█'.repeat(repeat.total)}${' '.repeat(20 - repeat.total)}]\` **${statTotal}**
`)
.addField(' Abilities', variety.abilities.join('/'))
.addField(' Smogon Tiers', `[${data.smogonTiers[game].join('/')}](${data.smogonURL})`)
.addField(' Smogon Tiers', `[${data.smogonTiers[game].join('/')}](${data.smogonURL}) (${games[game]})`)
.addField(' Other Forms', stripIndents`
_Use ${this.usage(`${data.id} <form>`)} to get stats for another form._