fightmegg / riot-api

Client for Riot Games API
MIT License
87 stars 22 forks source link

getBySummonerName is not a function #616

Closed ilxlodev closed 1 month ago

ilxlodev commented 1 month ago

Hello!

I'm starting to use your little library to do a private integration.

While I was doing a couple of tests to get used to it, using the following example:

const { RiotAPI, RiotAPITypes, PlatformId } = require("@fightmegg/riot-api");

const rAPI = new RiotAPI(process.env.RIOT_API_KEY);

const summoner = await rAPI.summoner.getBySummonerName({
  region: PlatformId.EUW1,
  summonerName: "Demos Kratos",
});

I've noticed that the error "TypeError: rAPI.summoner.getBySummonerName is not a function" is thrown.

I have compared it with the example in the README and it seems to be correct... Could it be a bug?

To debug a little, I made a console.log of rAPI.summoner and, it seems that the "getBySummonerName" method does not exist, is this intentional?

{
  getByRsoPUUID: [Function: getByRsoPUUID],
  getByAccountId: [Function: getByAccountId],
  getByPUUID: [Function: getByPUUID],
  getBySummonerId: [Function: getBySummonerId],
  getByAccessToken: [Function: getByAccessToken]
}

Greetings!

OllieJennings commented 1 month ago

Hey @ilxlodev, getBySummonerName is no longer supported by the Riot API: https://developer.riotgames.com/apis#summoner-v4

It has been removed as they have transitioned across to RiotID / RiotTag.

Apologies for the confusion in the README, l need to get that fixed.

ilxlodev commented 1 month ago

Okay. Thanks for the clarification!