Different responses to the command

Nightbot doesn’t read variables when called from a Pastebin, because it reads and replaces the variables once, so it just calls your Pastebin and that’s it. What you have to do is define $(user) outside of the Pastebin, and then you can refer it inside and JavaScript will do the job. So your command would go like this:

$(eval u=`$(user)`; a=$(urlfetch json https://pastebin.com/raw/7FGZVsy3); a[Math.floor(Math.random()*a.length)];)

And then in the Pastebin replace every instance of $(user) with ${u}.

Did I understand correctly?
Do I need to replace $(user) with ${u} in Pasterbin?

Yes that is all you have to do as long as it’s inside of ``

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