I'm trying to make a REPL module/command for my Discord bot, but I'm having some issues. I've tried dumbing the code down as much as I could and having it be as unrelated to the bot as I could, but I can't get it to work:const spawn = require('child_process').spawn;const node = spawn('node', []);node.stdin.write("2+2")node.stdout.on('data', (data) => {console.log(data)});` The above example is a very basic one, but I've also tried replacing the write() with stuff that I would be able to witness outside of the REPL(sending a message). The code I used to try this worked totally fine when I actually did it in the REPL itself. Anyone able to help?Running on the latest v7.7.2.
Submitted March 10, 2017 at 07:47PM by Dynamexia
No comments:
Post a Comment