mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-03 23:36:43 +02:00
Fix
This commit is contained in:
@@ -96,6 +96,9 @@
|
||||
}
|
||||
],
|
||||
"moveSetVersion": "red-blue",
|
||||
"smogonTiers": {
|
||||
"rb": ["Anything Goes"]
|
||||
},
|
||||
"encounters": [],
|
||||
"chain": [0],
|
||||
"missingno": true,
|
||||
|
||||
@@ -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._
|
||||
|
||||
|
||||
@@ -139,7 +139,7 @@ module.exports = class Pokemon {
|
||||
}
|
||||
|
||||
get smogonURL() {
|
||||
if (this.missingno) return null;
|
||||
if (this.missingno) return missingno.url;
|
||||
return `https://www.smogon.com/dex/${this.id > 807 ? 'ss' : 'sm'}/pokemon/${this.slug}/`;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user