I keep getting an "Unexpected identifier" message when I test my command.

Asked Feb 17, 2025·1 reply·Last activity 1 year 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.

So I created a command meant to use a random message from a pastebin i made and when I was trying to test it i got "unexpected identifier" back...

The code is: $(eval a=$(urlfetch json https://pastebin.com/raw/Ts7iVfHj);a[Math.floor(Math.random()*a. length)])

Any help would be appreciated!

1 reply

try the following:

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