Invalid or Unexpected Token

Asked Mar 3, 2021·2 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.

Hey guys! I'm trying to run a command that pulls random quotes from a document on pastebin, but when I type the command it comes up with "Invalid or Unexpected Token." The code I used on Nightbot is:
$(eval a=$(urlfetch json https://pastebin.com/raw/kGUkD5Kt);a​[Math.floor(Math.random()*a.length)])

And the pastebin is https://pastebin.com/raw/kGUkD5Kt (Don't ask. I just wanted to be sarcastic and have a bunch of quotes about chaos come up because of my username lmao)

Does anyone have any ideas about what could be causing this? I greatly appreciate your time!

2 replies

Instead of “|” in your pastebin it should be “,”

Thanks for the response :D I originally had them as commas and it came up as "unexpected identifier" when I tried it in chat, and someone suggested I switch to using "|"s