Hi there,
I was trying to create a dynamic !rank command that uses the game title on stream to call the relevant API to display my rank in each game. I got it working pretty well, but I’m limited in how long the command can be, so can’t add every game that I play.
The command that I’m currently using is:
*$(eval var r = false; if(’$(twitch dobton_ “{{game}}”)’ == “Rocket League”) r = “$(urlfetch https://bit.ly/link)”; *
else if(’$(twitch dobton_ “{{game}}”)’ == “VALORANT”) r = “$(urlfetch https://bit.ly/link)”;
*else if(’$(twitch dobton_ “{{game}}”)’ == “League of Legends”) r = “$(leagueoflegends dobton euw)”; *
else if(’$(twitch dobton_ “{{game}}”)’ == “Teamfight Tactics”) r = “$(leagueoflegends dobton euw ranked_tft)”; if® 'Current rank: ’ + r + ‘.’; else ‘At least Plat.’; )
I’ve had to use bitly to shorten the URLs for the urlfetches to fit (removed the actual links).
I’m just wondering if there is a better way of doing this? I originally looked at creating a command that would call a game specific rank command based on the game title, but from what I’ve read this isn’t possible. Would I have to create a script or API to achieve the desired result?