NightBot Command for Apex Legends

Asked May 12, 2023·1 reply·Last activity 3 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 was curious on how to make a command in twitch that received my rank, name, and elo for Apex Legends saying I found one for Valorant.

I got a reply saying to use this

$(eval d=$(urlfetch https://api.2g.be/games/apex?q=stats%20USERNAME%20origin).replace(/\[|\]/g,`).split(|); o=d.filter(e=>e.includes(Rank)); u=d[0].split(:).shift(); $(user) — ${u}: ${o[0]}`)

but when I put this in the nightbot command and put my username in it responds with this in my twitch chat "ldittoe : undefined" and when you search the url with my username it says "No player and/or platform provided"

1 reply

Hey @Artful Shrimp!

There likely is an error somewhere in your code. Try this:

$(eval d = `$(urlfetch https://api.2g.be/games/apex?q=stats%20USERNAME%20origin)`.replace('[', '| ').replace(']', '').split('|'); `$(user) — ${d[0].replace(':', `'s`} ${d.filter(e => e.includes('Rank'))[0]}`;)