Hey guys I’ve tried searching the forums but haven’t had any luck with finding an answer. While trying to find some commands that I can add to twitch which involve code I’ve found a lot of commands with an $eval at the start. I’ve tried adding them as commands but it just shows the code instead of what I want the code to do when the command is typed in. I assume there’s something I’m missing or something extra I need however I’m not sure where to get this information or where to start.
Complete beginner here
15 replies
Well for the eval variable or any variable with nightbot you have to format a specific way in the case of eval it is $(eval JS_CODE)
For a better understanding I recommend you read the custom variable section of the docs. https://docs.nightbot.tv/
Though for most general things with nightbot you can find documentation on how it works at the above link too, not just the variables.
Also for future reference the commands you’ll find on here typically look the way they should when you add it without the need to remove any parentheses or characters (unless specifically noted) as that is important for how nightbot reads the command.
Thanks for your response! I’ve checked out the link and will keep reading however the question I have is why I can’t get any kind of eval variable to work even using the simple examples in the eval guide and copy and pasting the examples in the forums without editing them? Provided the JavaScript code is all correct should it just work when I add it as a command in twitch chat?
Yes the examples on the forums should work how are you adding the commands? There’s a few things I think that could cause that. If your adding it on mobile via the twitch app that could be the issue.
Also if you could add this command and attach a screen shot of what your seeing when you go to use it.
!addcom !test $(eval 1+1)
Ok is this in a stream you moderate for or your own? Because if it’s your own I 100% recommend adding commands through the dashboard.
As for the potential issue with mobile I noticed some time ago probably over a year that when copy and pasting anything with " in it became “ which is not good because it will cause the code to not function.
Cuddly Shrimp said:
I tried adding that but nothing comes up when I do.
Whenever you say this you mean nightbot did not respond at all. But it is replying to other messages right?
For that you just need to copy and paste everting in the block exactly as is. Is that what you did?
Ok you are not using nightbot your using stream elements which explains the issue your having because they are two completely different things please contact them for help with anything related to their bot https://support.streamelements.com/en
I’m sorry I can’t be of more help but these forums are for nightdev products specifically.
Yes streamelements and nightbot work completely independent of one another and the commands they use are incompatible with eachother.
If you are interested in nightbot you can set it up here https://nightbot.tv/
Didn't find your answer? The community is on Discord.
Ask on Discord
