I have a custom command to pull a random dad joke from a Pastebin list, which I add new entries to sometimes. It’s an exclusive command for a specific user, with a default response if anyone else tries to use it. For namesake, I’ll use my username to present the command here rather than that specific user’s.
$(eval ‘$(user)’ == ‘iLLadelph267’ ? ‘$(eval a=“$(urlfetch json https://pastebin.com/raw/U0xphXnF)”.split(“;”);a[Math.floor(Math.random()*a.length)])’ : “Sorry, only iLLadelph267 can be blamed for dad jokes” )
I added a bunch of new ones today but keep getting an Unexpected Identifier. I’ve had this issue before and fixed the separator appearing within entries. But now its returning “Unexpected Identifier ‘Where’ context:1:59” after the latest change even though the only place a semicolon appears is between entries as intended.
Also, I’m very confused about the ‘Where’ context:1:59 part. Prior to the latest change, it returned Unexpected Identifier ‘What’ context:1:58 and I assumed it was pointing to line 58 in the Pastebin. On line 59 was a joke starting with the word “What” so I elected to delete that entry. Now it returns this ‘Where’ context:1:59 but line 59 doesn’t contain the word “where” telling me I misunderstood what the part meant.
I’ve no idea why any of the entries in there would cause an issue. Should I change my separator? Why is it pointing out words like ‘Where’ and ‘What’? What does context:number:number mean? Is there an issue with the way my command is written that I’m just not seeing?