I am trying to set up a command that will pull a random roast from a pastebin I made. I haven’t used a pastebin before, so I’m sure there’s some issues I have in there. I can’t figure it out for the life of me. The error I’m getting is “Unexpected identifier ‘You’ [:1:129]”.
Here’s the code: $(eval a=$(urlfetch json https://controlc.com/600c4f56 ).split(“|”);a[Math.floor(Math.random()*a.length)])
I was going to use pastebin.com, but it seems the server is down so I went to controlc instead.
it’s because u’ve used backticks both around your $(urlfetch) AND in your quotes… so what it sees is `[` as a string and the first word in the first quote (You) outside of the backticks (it would also see every other word of the first quote outside of the backticks, but the first one already threw the error)… few ways to fix… personally i’d probably change all the |'s to commas and remove the .split("|")…
… but u could instead, remove the brackets ([]) inside the linked paste and change the backticks around the $(urlfetch) to quotes (this makes it look kinda cool in discord)