Querijn/BottyMcBotface

Wrong url used for parsing games

Closed this issue · 0 comments

Botty currently parses games by specifying a set of league ids, when it should use the wildcard all instead.

const data = await fetch("https://eu.lolesports.com/en/api/widget/schedule?timezone=UTC&leagues=26&leagues=3&leagues=2&leagues=6&leagues=7&leagues=5&leagues=4&leagues=9&leagues=10&leagues=1&leagues=43&slug=all");

This also has the added bonus that the following code can be removed in favor for parsing the url from the html, since the all slug includes that link

private getUrlByLeague(leagueName: string) {
// Hotfix for worlds
if (leagueName === "World Championship") leagueName = "worlds";
return "https://eu.lolesports.com/en/league/" + leagueName.replace(/ /g, "-").toLowerCase();
}