I have a API which shows all the things I want in the command ... but I'm facing difficulties in trying to show them in chat.. /t/valorant-ranked-command/1534635943531909273 ... i did read this thread but I still couldn't figure it out ... any help would be appreciated ... I would paste the API link here but idk if its safe cuz it has riot actID in it.
!leaderboard command for nightbot
4 replies
@Gerhard Ok thanks for replying ... i cant post the API link directly but i tried getting the leaderboard ranks using this command with nightbot ... but it gives me "unexpected token '(' error " ... the API link is in this command
js$[eval const api = `$(urlfetch json https://dgxfkpkb4zk5c.cloudfront.net/search/affinity/NA/queue/competitive/act/2a27e5d2-4d30-c9e2-b15a-93b8909a442c/gameName/root/tagLine/1288)`;var (putname) = api.players.find(e => e.puuid === "insertpuuid"); putname? putname is #${putname['leaderboardRank']} on the leaderboard with ${putname['numberOfWins']} Wins and a RR of ${putname['rankedRating']} : 'fail to get rank']
Thanks for sharing, you can use 3 backticks ``` to wrap your code inside a code block on the forums.
I slightly changed your command, try it out:
js$(eval const api = $(urlfetch json https://dgxfkpkb4zk5c.cloudfront.net/search/affinity/NA/queue/competitive/act/2a27e5d2-4d30-c9e2-b15a-93b8909a442c/gameName/root/tagLine/1288); var putname = api.players.find(e => e.puuid === "xx"); putname ? `${putname.gameName} is #${putname.leaderboardRank} on the leaderboard with ${putname.numberOfWins} Wins and a RR of ${putname.rankedRating}` : 'fail to get rank')