Hi,
I’ve found this response code for nightbot to randomly generate a response when command is utilized, but it tells me “Right-hand side of ‘instanceof’ is not an object.” I’ve looked through several options with the same issue, but can’t find the error in this code:
I have been trying to use $(eval a=$(urlfetch json https://twitch.center/customapi/quote/list?token=Public_Token).match(/~\d+K~/g);a?(b=a.length,c=(+a.map(x=>x.slice(1,x.length-1)).join(,)+)):(b=0,c=``);`$(channel) has ${b} wins ${c})
and i keep getting Not an “instanceof”. I’ve tried changing the { to [ and its still didn’t work. This is all for a kill counter. Any idea what is wrong?
I assume you’ve already obtained a public and private token from the quote system… so delete copy and paste the following command response. Replace PUBLIC_TOKEN with your public token.
$(eval a=`$(urlfetch json https://twitch.center/customapi/quote/list?token=PUBLIC_TOKEN)`.match(/~\d+K~\d+~/g);a?(a=a.filter(x=>x.split(`~`)[2]==a[a.length-1].split(`~`)[2]&&x.split(`~`)[1]!=`0K`),b=a.length,c=a.length?`(`+a.map(x=>x.split(`~`)[1]).join(`, `)+`)`:``):(b=0,c=``);`$(channel) has ${b} wins ${c}`)