Command used to work, doesn't anymore


So a few years back I got help to make this command called !puns, basically it just picks a random one from a Pastebin and it used to be fine and work and all was good. However, I added some new things to the list and now only comes back as “unexpected identifier”.

The API is as follows:
$(eval pun=’$(urlfetch json’.split(’*’);pun[Math.floor(Math.random()*pun.length)])

I can’t tell you what everything does as I got help but if anyone can help get it working again it would be appreciated.

Many thanks

Hey @sir_ovbov!

You must have copied it to a word processing software and it changed your quotation marks from ' to , your code can’t work because isn’t recognized by Javascript as a quotation mark, the three types that are allowed are: "`'.

So by simply replacing your quote marks with proper ones, that’ll fix it:

$(eval pun=`$(urlfetch json`.split(`*`);pun[Math.floor(Math.random()*pun.length)])

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.