Unexpected identifier

Asked Jul 24, 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.

Hi, if been looking at this for a while and tried solutions I could find online but I still get the error Unexpected identifier. I want to creat a list of Items of which nightbot than picks one randomly

$(eval a=$(urlfetch json https://pastebin.com/raw/JZHKssVp).split(|);a[Math.floor(Math.random()*a.length)])

Can someone help me spot the mistake or mistakes?

1 reply

likely the lack of quotes in the split... .split("|") should work better