Nightbot edit command?

Asked Jul 26, 2020·2 replies·Last activity 6 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 have this code where if the $(user) leaves $(query) blank it will select a random user and if user chooses to @ a user it will select the $(touser) but I'm trying to exclude nightbot , wizebot from random user ? How would i do this

This is what i have now?

$(eval a=decodeURIComponent($(querystring)).replace(/@/g,`);a?a:$(urlfetch https://decapi.me/twitch/random_user/$(channel)?exclude=Nightbot,Wizebot)) and he $(eval a=[Won,Lost`];a[Math.floor(Math.random()*a.length)])

2 replies

Hey @Tidy Snail!

Looks like it'd work, I improved it slightly though if you're interested:

$(eval `$(query)`?a=`$(touser)`:a=`$(urlfetch https://decapi.me/twitch/random_user/$(channel)?exclude=nightbot,wizebot)`;b=[`won`,`lost`];`$(user) started a fight with ${a} and they ${b[Math.floor(Math.random()*2)]}.`)

Thank you! Have a wonderful day/night emily!