KnutZuidema / golio

League of Legends, Legends of Runeterra and Valorant API client library for Go
MIT License
73 stars 29 forks source link

Implement the `ChampionByKey` function and fix a bug related to fetching the champion data from spectator participant. #70

Open Nico-Mayer opened 4 months ago

Nico-Mayer commented 4 months ago

This pull request adds a function to retrieve champion data by passing the champion key as a function parameter. This change addresses an issue with the current implementation of CurrentGameParticipant.GetChampion, which internally calls client.GetChampionById. Although this might initially seem correct, it is problematic due to the misleading naming of the fields in Data Dragon. The championId should be a string representing the code name of the champion, while the returned value in the documentation is the champion key as a number.

image

This update corrects this behavior, ensuring that champions are returned correctly.

Nico-Mayer commented 3 months ago

@KnutZuidema Yea i also think this is a bug or just bad naming in the riot api.

What kind of comment would you want to add here to make it clear? :)

KnutZuidema commented 2 months ago

@Nico-Mayer just that the ChampionID field is also the champion key in some use cases.