mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-06 14:20:51 +02:00
Support More Pokemon
This commit is contained in:
@@ -19,7 +19,7 @@ module.exports = class Pokemon {
|
||||
: [{ name: slugName, language: 'en' }];
|
||||
this.genus = data.genera.length
|
||||
? `The ${data.genera.filter(entry => entry.language.name === 'en')[0].genus}`
|
||||
: 'Galar Native';
|
||||
: 'Undiscovered Pokémon';
|
||||
this.varieties = data.varieties.map(variety => {
|
||||
const name = firstUpperCase(variety.pokemon.name
|
||||
.replace(new RegExp(`${this.slug}-?`, 'i'), '')
|
||||
@@ -38,7 +38,9 @@ module.exports = class Pokemon {
|
||||
};
|
||||
this.typesCached = data.missingno || false;
|
||||
this.missingno = data.missingno || false;
|
||||
this.cry = path.join(__dirname, '..', '..', 'assets', 'sounds', 'pokedex', `${data.id}.wav`);
|
||||
this.cry = data.id > store.pokemonCountWithCry
|
||||
? null
|
||||
: path.join(__dirname, '..', '..', 'assets', 'sounds', 'pokedex', `${data.id}.wav`);
|
||||
}
|
||||
|
||||
get displayID() {
|
||||
|
||||
@@ -4,6 +4,13 @@ const Pokemon = require('./Pokemon');
|
||||
const missingno = require('../../assets/json/missingno');
|
||||
|
||||
module.exports = class PokemonStore extends Collection {
|
||||
constructor(options) {
|
||||
super(options);
|
||||
|
||||
this.pokemonCount = 897;
|
||||
this.pokemonCountWithCry = 893;
|
||||
}
|
||||
|
||||
async fetch(query) {
|
||||
query = this.makeSlug(query);
|
||||
if (!query) return null;
|
||||
|
||||
Reference in New Issue
Block a user