From 2444e6263d37d2ec475736ff8914b3d63392d3c8 Mon Sep 17 00:00:00 2001 From: Neko-Life Date: Fri, 6 Aug 2021 10:27:13 +0700 Subject: [PATCH] better stdio handling --- cmds/owner/update.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/cmds/owner/update.js b/cmds/owner/update.js index 165bb6b..431a3de 100644 --- a/cmds/owner/update.js +++ b/cmds/owner/update.js @@ -2,7 +2,7 @@ const commando = require("@iceprod/discord.js-commando"), { exec } = require("child_process"), - { errLog, trySend } = require("../../resources/functions"); + { trySend } = require("../../resources/functions"); module.exports = class update extends commando.Command { constructor(client) { @@ -16,12 +16,13 @@ module.exports = class update extends commando.Command { }); } async run(msg) { - exec("bash .update.sh", async (xe, o, e) => { - if (xe || e) { - await errLog(xe || e, msg, msg.client, true, "", true); - } - if (o) return trySend(msg.client, msg, o); - return trySend(msg.client, msg, "Done"); + let ret = []; + await exec("bash .update.sh", async (xe, o, e) => { + for (const M of [xe, o, e]) + if (M) + ret.push(await trySend(msg.client, msg, M)); + ret.push(await trySend(msg.client, msg, "Done")); }); + return ret; } }; \ No newline at end of file