!elo not working

Asked Sep 25, 2023·1 reply·Last activity 2 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.

Hi guys, i paste command to nightbot - !elo

$(eval const o = $(urlfetch json https://wombot.fi/nightbot/elo/USERNAME?format=full); o.message || Level ${o.level} | ${o.elo} Elo | ${o.eloDiff > 0? "+" : ""}${o.eloDiff} today | ${o.recentMatches.filter(m=> m.teamId === m.i2).length} Wins | ${o.recentMatches.filter(m=> m.teamId !== m.i2).length} Losses ${(o.estWin && o.estLoss) ? | Est Win: +${o.estWin}, Est Loss: -${o.estLoss} : ""})

But when i trying it, Nightbot says : Unexpected identifier
How 2 fix?

1 reply

i feel like a couple symbols r missing... purely based on the code... and then it appears u need to change USERNAME in the link to a username, i'm assuming for an in game name for whatever elo is...

$(eval const o = $(urlfetch json https://wombot.fi/nightbot/elo/USERNAME?format=full);`${o.message} || Level ${o.level} | ${o.elo} Elo | ${o.eloDiff > 0? "+" : ""}${o.eloDiff} today | ${o.recentMatches.filter(m=> m.teamId === m.i2).length} Wins | ${o.recentMatches.filter(m=> m.teamId !== m.i2).length} Losses ${(o.estWin && o.estLoss) ? `| Est Win: +${o.estWin}, Est Loss: -${o.estLoss}` : ""}`)