Fix tweet

This commit is contained in:
Dragon Fire
2024-03-22 14:36:09 -04:00
parent 1b3c1c8909
commit 182bf8c72f
9 changed files with 12 additions and 362 deletions
-13
View File
@@ -57,7 +57,6 @@ module.exports = class Pokemon {
this.weight = data.missingno ? data.weight : null;
this.moveSet = data.missingno ? data.moveSet : [];
this.moveSetVersion = data.missingno ? data.moveSetVersion : null;
this.trainerCardID = null;
this.gameDataCached = data.missingno || false;
this.gameDataFetching = data.missingno || false;
this.missingno = data.missingno || false;
@@ -168,18 +167,6 @@ module.exports = class Pokemon {
return this.smogonTiers;
}
async fetchCardID() {
if (this.trainerCardID) return this.trainerCardID;
const { body } = await request
.post('https://pokecharms.com/trainer-card-maker/pokemon-panels')
.attach('number', this.id)
.attach('_xfResponseType', 'json');
const $ = cheerio.load(body.templateHtml);
const id = $('li[class="Panel"]').first().attr('data-id');
this.trainerCardID = id;
return id;
}
async fetchGameData() {
if (this.gameDataCached) return this;
if (this.gameDataFetching) {