From d7e319e3321c1db4dae4a69d2ade92f4762062ea Mon Sep 17 00:00:00 2001 From: ledouxm Date: Sat, 13 Jan 2024 11:38:45 +0100 Subject: [PATCH] fix: use riot account api --- src/features/summoner.ts | 15 ++++++++++++--- 1 file changed, 12 insertions(+), 3 deletions(-) diff --git a/src/features/summoner.ts b/src/features/summoner.ts index 16b2761..8584c1f 100644 --- a/src/features/summoner.ts +++ b/src/features/summoner.ts @@ -15,9 +15,18 @@ export const addRequest = async () => { }; export const galeforce = new Galeforce({ "riot-api": { key: process.env.RG_API_KEY } }); -export const getSummonerByName = async (name: string) => { - const summoner = await galeforce.lol.summoner().region(galeforce.region.lol.EUROPE_WEST).name(name).exec(); - await addRequest(); +export const getSummonerByName = async (name: string, tag: string) => { + const account = await galeforce.riot.account + .account() + .gameName(name) + .tagLine(tag) + .region(galeforce.region.riot.EUROPE) + .exec(); + const summoner = await galeforce.lol + .summoner() + .region(galeforce.region.lol.EUROPE_WEST) + .puuid(account.puuid) + .exec(); return summoner; };