Skip to content

Commit

Permalink
fix: use riot account api
Browse files Browse the repository at this point in the history
  • Loading branch information
ledouxm committed Jan 13, 2024
1 parent 937f97f commit d7e319e
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/features/summoner.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
};

Expand Down

0 comments on commit d7e319e

Please sign in to comment.