Command help please

Asked Mar 19, 2022·2 replies·Last activity 4 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.

I’m new to writing commands and trying to get a random quote from a pastebin. But can’t get it to work.

Is anyone able to let me know what I’ve done wrong
My command is
$(eval a='$(urlfetch json https://pastebin.com/MeEaJ5Wy)'.split('#'); a[Math.floor(Math.random()*a.length)])

2 replies

For pastebin links you usually will need https://pastebin.com/raw/MeEaJ5Wy so it only pulls the strings.

Thank you for the reply.

after a lot of google searching and some trial and error I managed to get the command working, before my account was out of the (new account) holding period and my post was allowed.
I had indeed missed the /raw/ out of the command link and had some formatting in the pastebin that was causing nightbot to return error messages.