bot.exec: force buffers
This commit is contained in:
parent
b987ec9755
commit
263166c84f
1 changed files with 4 additions and 4 deletions
|
@ -28,18 +28,18 @@ function spawn(args) {
|
||||||
stdout: {
|
stdout: {
|
||||||
on: (event, handler) =>
|
on: (event, handler) =>
|
||||||
proc.stdout.on(event, (data) => {
|
proc.stdout.on(event, (data) => {
|
||||||
handler(data.toString("utf8"));
|
handler(Buffer.from(data).toString("utf8"));
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
stderr: {
|
stderr: {
|
||||||
on: (event, handler) =>
|
on: (event, handler) =>
|
||||||
proc.stderr.on(event, (data) => {
|
proc.stderr.on(event, (data) => {
|
||||||
handler(data.toString("utf8"));
|
handler(Buffer.from(data).toString("utf8"));
|
||||||
}),
|
}),
|
||||||
},
|
},
|
||||||
on: (event, handler) =>
|
on: (event, handler) =>
|
||||||
proc.on(event, (data) => {
|
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";
|
out += data + "\n";
|
||||||
});
|
});
|
||||||
proc.stderr.on("data", (data) => {
|
proc.stderr.on("data", (data) => {
|
||||||
out += data + "\n";
|
out += "ERR: " + data + "\n";
|
||||||
});
|
});
|
||||||
|
|
||||||
proc.on("close", async (code) => {
|
proc.on("close", async (code) => {
|
||||||
|
|
Loading…
Reference in a new issue