!leaderboard command for nightbot

Asked Aug 20, 2021·4 replies·Last activity 5 years ago·Open in Discord ↗
Archived from the original community forum
Things may have changed since it was written. Still stuck? Ask the community on Discord.

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.

4 replies

Hiya, without any info we can't help. What's your command look like, or what API are you using?
If actID is your account ID that seems to me like thats just public available info.

@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')

Thanks a lot for helping me out .. it worked