So, Im here today wondering if its possible to call commands from the node.js console that can be specified in functions in the code…
For Example ( Just a stupid hello world example ), but say i could run the console, and i could type a string into the console, and it would run it…. Or just simply as defining a custom command and having it call to a function…
My goal here is to be able to build a interface for Turntable, so i could possibly have the bot kick a user by defining a function of kickuser username reason, just by calling it from the console….
Any help would be extremely amazing…
Thanks,
You can do that in many ways.
The most common is to create a URL that only can be accessed by
localhostthat run the command you want to kick the user, then you can usecurlor create a node script that trigger that url passing the desired params.Another way, more advanced, is to listen for
socketconnections from local, and expose the methods you want to execute to do jobs. Then you can create another script that when run, will connect the socket and send commands for your server.Some projects that may help you: