2022 visit: it’s fun seeing where I started, now JavaScript is my best friend.
Hey there!
I’m trying to build a command with Nightbot which gives a different output depending of the input…
The command should display the server on which the streamer is playing depending of the game played.
I tried some things but I keep getting an error in return: "Right-hand side of 'instanceof' is not an object"
Disclaimer: I don’t know anything about javascript, but I try by using examples I find on the forum, haha!
So, here’s what I tried so far, they are pretty much all the same, I just tried different way to type it:
!addcom !server $(eval responses = {if($(twitch username “{{game}}”) = “game1”){response = “user is currently playing on server1.”}};{if($(twitch username “{{game}}”) = “game2”){response = “user is currently playing on server2.”}};{“user isn’t currently playing on a server.”})
!addcom !server $(eval responses = {if($(twitch username “{{game}}”) = “game1”){“user is currently playing on server1.”}};{if($(twitch username “{{game}}”) = “game2”){“user is currently playing on server2.”}};{“user isn’t currently playing on a server.”})
!addcom !server $(eval {if($(twitch username “{{game}}”) = “game1”){response = “user is currently playing on server1.”}};{if($(twitch username “{{game}}”) = “game2”){response = “user is currently playing on server2.”}};{response = “user isn’t currently playing on a server.”})
Any help is highly appreciated!
Thanks in advance!
Edit: I don’t have access to the control panel, I can only add commands via the Twitch chat…