added eune support

main
Benjamin Kraft 4 months ago
parent 51ea3a4e52
commit 256e5a607e
  1. 28
      src/player.ts

@ -54,18 +54,32 @@ export class Player {
}
async updateCurrentElo() {
let entries;
try {
entries = await riotAPI.league.getEntriesBySummonerId({
region: PlatformId.EUW1,
const tryRegion = async (region: RiotAPITypes.LoLRegion) => {
return await riotAPI.league.getEntriesBySummonerId({
region: region,
summonerId: (await riotAPI.summoner.getByPUUID({
region: PlatformId.EUW1,
region: region,
puuid: this.puuid
})).id
});
};
let entries;
try {
entries = await tryRegion(PlatformId.EUW1);
} catch (error){
console.error(await(error as Response).json());
return;
let response = error as Response;
console.error(await response.json());
console.log(`Trying EUNE Region...`);
try {
entries = await tryRegion(PlatformId.EUNE1);
console.log(`Success with EUNE`);
} catch (error){
let response = error as Response;
console.error(await response.json());
return;
}
}
let soloQ = entries.find(e => e.queueType == "RANKED_SOLO_5x5");

Loading…
Cancel
Save