mirror of
https://github.com/arthur-pbty/xiao.git
synced 2026-06-24 10:25:11 +02:00
Fix locations for pokemon
This commit is contained in:
@@ -338,8 +338,10 @@ module.exports = class Pokemon {
|
|||||||
if (!encounter.version_details.some(version => versions[version.version.name])) continue;
|
if (!encounter.version_details.some(version => versions[version.version.name])) continue;
|
||||||
const { body: encounterBody } = await request.get(encounter.location_area.url);
|
const { body: encounterBody } = await request.get(encounter.location_area.url);
|
||||||
const { body: locationBody } = await request.get(encounterBody.location.url);
|
const { body: locationBody } = await request.get(encounterBody.location.url);
|
||||||
|
let name = locationBody.names.find(nm => nm.language?.name === 'en')?.name;
|
||||||
|
if (!name) name = firstUpperCase(locationBody.name.replace(/-/g, ' '));
|
||||||
this.encounters.push({
|
this.encounters.push({
|
||||||
name: locationBody.names.find(name => name.language.name === 'en').name,
|
name,
|
||||||
versions: encounter.version_details
|
versions: encounter.version_details
|
||||||
.filter(version => versions[version.version.name])
|
.filter(version => versions[version.version.name])
|
||||||
.map(version => version.version.name)
|
.map(version => version.version.name)
|
||||||
|
|||||||
Reference in New Issue
Block a user