This commit is contained in:
Dragon Fire
2021-01-18 18:18:02 -05:00
parent 0732c536e7
commit 5e43bae03f
2 changed files with 8 additions and 1 deletions
+1 -1
View File
@@ -76,7 +76,7 @@ module.exports = class PokedexCommand extends Command {
};
const embed = new MessageEmbed()
.setColor(0xED1C24)
.setAuthor(`#${data.displayID} - ${data.name}`, data.boxImageURL, data.serebiiURL)
.setAuthor(`#${data.displayID} - ${data.name}`, data.formBoxImageURL(variety.id), data.serebiiURL)
.setThumbnail(data.formSpriteImageURL(variety.id))
.addField(` Base Stats (${variety.name || 'Base'} Form)`, stripIndents`
\`HP: [${'█'.repeat(repeat.hp)}${' '.repeat(20 - repeat.hp)}]\` **${variety.stats.hp}**
+7
View File
@@ -121,6 +121,13 @@ module.exports = class Pokemon {
return `https://www.serebii.net/pokedex-swsh/icon/${this.displayID}.png`;
}
formBoxImageURL(variety) {
if (this.missingno) return missingno.box;
const found = this.varieties.find(vrity => variety ? vrity.id === variety.toLowerCase() : vrity.default);
const name = found.default ? '' : found.name.toLowerCase().split(' ').map(n => n.charAt(0)).join('');
return `https://www.serebii.net/pokedex-swsh/icon/${this.displayID}${name ? `-${name}` : ''}.png`;
}
get serebiiURL() {
if (this.missingno) return missingno.url;
return `https://www.serebii.net/pokedex-swsh/${this.displayID}.shtml`;