bot.exec: force buffers

This commit is contained in:
Cynthia Foxwell 2021-07-23 17:00:20 -06:00
parent b987ec9755
commit 263166c84f

View file

@ -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) => {