diff --git a/src/modules/bot.js b/src/modules/bot.js index 1e0a778..a99315a 100644 --- a/src/modules/bot.js +++ b/src/modules/bot.js @@ -28,18 +28,18 @@ function spawn(args) { stdout: { on: (event, handler) => proc.stdout.on(event, (data) => { - handler(data.toString("utf8")); + handler(Buffer.from(data).toString("utf8")); }), }, stderr: { on: (event, handler) => proc.stderr.on(event, (data) => { - handler(data.toString("utf8")); + handler(Buffer.from(data).toString("utf8")); }), }, on: (event, handler) => proc.on(event, (data) => { - handler(data.toString("utf8")); + handler(Buffer.from(data).toString("utf8")); }), }; } @@ -128,7 +128,7 @@ exec.callback = async function (msg, line) { out += data + "\n"; }); proc.stderr.on("data", (data) => { - out += data + "\n"; + out += "ERR: " + data + "\n"; }); proc.on("close", async (code) => {