Hey @steelboost!
If you want to use Nightbot variables values inside a Pastebin, you need to call them before entering the Pastebin as Nightbot reads that code but doesn’t replace the variables, it’s linked to how JS works.
So for your code, here’s how to do it, call the $(urlfetch)
and define $(user)
outside of the paste:
$(eval r=`$(urlfetch json http://tmi.twitch.tv/group/user/$(channel)/chatters)`; u=`$(user)`; $(urlfetch https://pastebin.com/raw/QNGztScQ))
And inside your paste QNGztScQ
, have the rest of the code:
try{c=JSON.parse(r).chatters;a=c.vips.concat(c.moderators,c.staff,c.admins,c.global_mods,c.viewers).filter(n=>![`${u}`,`Nightbot`,`aten`,`Kodiakbrujah`,`Ildelara`,`Connoted`,`Casinothanks`,`streamelements`].some(o=>n.toLowerCase()==o.toLowerCase()));a.length?a[Math.floor(Math.random()*a.length)]:`No chatters`}catch(e){`Couldn't fetch the list of chatters: ${e}: ${r}`.slice(0,400)}
Notice I replaced $(user)
by ${u}
since we defined the variable earlier.