Hello, I'm trying to make a command where it chooses a random viewer on the chat, but I tried to filter the bots out and for some reason the broadcaster won't get picked by the command. Could anyone help me out?
$(eval r=$(urlfetch json http://tmi.twitch.tv/group/user/$(channel)/chatters);try{c=JSON.parse(r).chatters;a=c.moderators.concat(c.staff,c.admins,c.global_mods,c.viewers).filter(n=>!["streamelements","soundalerts","lolrankbot","creatisbot","nightbot","nome"].some(o=>n.toLowerCase()==o.toLowerCase()));a.length>0?a[Math.floor(Math.random()*a.length)]:No chatters!}catch(e){Error: ${e.message}: ${r}.substr(0,400)})