Calling Nightbot variable $(user) from Pastebin

Asked Feb 6, 2022·1 reply·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.

Alright, so what my code wants to do is, upon calling, pull a random string from a Pastebin, which by itself works just fine.
However, I also want to call $(user) from within these string values, which I understand is harder than just putting $(user) in the beginning of the command because of how js works.
So, I try to code it to recognize before the random string code, but it keeps giving me an 'Unexpected identifier' error.
I've looked at past topics here and elsewhere on the topic and applied the advice, but it still doesn't work.
Does a code like this still work on Nightbot in February 2022?

!thighs $(eval r="$(urlfetch json http://tmi.twitch.tv/group/user/$(channel)/chatters)";eval baby="$(user)";eval a="$(urlfetch json https://pastebin.com/raw/1En8fN5y)".split(";");a[Math.floor(Math.random()*a.length)])

Pastebin is inside the code.

Apologies for the lewdness in advance, it's kind of the channel brand, lol.

1 reply

You only need eval after the $( at the beginning the actual js doesn’t read that that’s what make it but whatever is in between the $(eval ) into something to evaluate the code so basically you just don’t need the other evals in their