feat: auto-detect latest champions version from Riot API

When championsVersion is empty, fetch the latest version from
ddragon.leagueoflegends.com instead of requiring a hardcoded value.
This commit is contained in:
tiennm99 committed 2026-04-05 12:13:43 +07:00
1 parent a12b5d2b5d
commit eddcfe25fa
2 files changed
+38 -2

No files matched your search

+7 -1
View File
@@ -11,7 +11,13 @@ import (
)
func main() {
champions, err := parser.ParseChampions(championsVersion)
version, err := getChampionsVersion()
if err != nil {
log.Fatalf("Failed to get champions version: %v", err)
}
fmt.Printf("Using champions version: %s\n", version)
champions, err := parser.ParseChampions(version)
if err != nil {
log.Fatalf("Failed to parse champions: %v", err)
}