I would like to create a 2 variable command with nightbot. I would have 2 different answer depending on whether the command is write in the title of the stream or not.
An example with “!test” command : Stream title 1 : New live today, welcome all In this case, if i type “!test” on the chat, nightbot answer : “non avaliable request” Stream title 2 : New live today, welcome all | Write !test on chat In this case, if i type “!test” on the chat, nightbot answer : “This is a test !”
I’ve tried it but it’s not working
Nightbot still responds “Invalid or unexpected token”
But i’ve tried to replace all " by backticks : $(eval t=$(twitch Channel {{title}});if(t.includes(!test)){this is a test;}else{no available request`;} )
and it’s half working ^^ , now nightbot always answer “no available request”
The issue was that you were using the wrong double quotes: “” instead of ", I personally prefer using single quotes ' they’re faster to type and look cleaner — the only exception is inside of the Twitch variable, there are double quotes " because they are required according to the documentation — and I use backticks ` only when I combine variables with text.
You were close, good job!