From 8bd14b54fa47625c9327e51f1df4cef5a1fa51c6 Mon Sep 17 00:00:00 2001 From: Neko-Life Date: Mon, 26 Jul 2021 15:10:13 +0700 Subject: [PATCH] add .sh --- cmds/owner/update.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmds/owner/update.js b/cmds/owner/update.js index 04e1a3b..a8fee1f 100644 --- a/cmds/owner/update.js +++ b/cmds/owner/update.js @@ -1,6 +1,8 @@ 'use strict'; -const commando = require("@iceprod/discord.js-commando"); +const commando = require("@iceprod/discord.js-commando"), + { exec } = require("child_process"), + { errLog, trySend } = require("../../resources/functions"); module.exports = class update extends commando.Command { constructor(client) { @@ -14,6 +16,12 @@ module.exports = class update extends commando.Command { }); } run(msg) { - + return exec("bash ../../.update.sh", (xe, o, e) => { + if (xe || e) { + await errLog(xe || e, msg, msg.client, true, "", true); + return; + } + if (o) return trySend(msg.client, msg, o); + }); } }; \ No newline at end of file