From 1fd3ca22720f19f4c82fc3a345b016f56a0da76b Mon Sep 17 00:00:00 2001 From: IdiNium <47635037+idinium96@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:24:34 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=F0=9F=94=A8=20fix=20`!updaterepo`=20comman?= =?UTF-8?q?d?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Commands/sub-classes/Manager.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/Commands/sub-classes/Manager.ts b/src/classes/Commands/sub-classes/Manager.ts index a53e6dc98..8e3b1b3de 100644 --- a/src/classes/Commands/sub-classes/Manager.ts +++ b/src/classes/Commands/sub-classes/Manager.ts @@ -945,7 +945,7 @@ export default class ManagerCommands { const exec = (command: string): Promise => { return new Promise((resolve, reject) => { child.exec(command, { cwd }, err => { - if (err && !['npm run build', 'pm2 restart ecosystem.json'].includes(command)) { + if (err && !['npm run build'].includes(command)) { // not sure why this error always appeared: https://prnt.sc/9eVBx95h9uT_ log.error(`Error on updaterepo (executing ${command}):`, err); return reject(err); @@ -975,7 +975,7 @@ export default class ManagerCommands { await exec('npm run build'); this.bot.sendMessage(steamID, '⌛ Restarting...'); - await exec('pm2 restart ecosystem.json'); + return await this.bot.botManager.restartProcess(); } catch (err) { this.bot.sendMessage(steamID, `❌ Error while updating the bot: ${JSON.stringify(err)}`); // Bring back to online From 6bf15ff1468e68c3c134c8cc6997bf445ad8dffb Mon Sep 17 00:00:00 2001 From: IdiNium <47635037+idinium96@users.noreply.github.com> Date: Fri, 23 Jun 2023 15:28:24 +0800 Subject: [PATCH 2/2] =?UTF-8?q?=F0=9F=94=A8=20maybe=20not=20needed?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/classes/Commands/sub-classes/Manager.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/classes/Commands/sub-classes/Manager.ts b/src/classes/Commands/sub-classes/Manager.ts index 8e3b1b3de..cd023ea9e 100644 --- a/src/classes/Commands/sub-classes/Manager.ts +++ b/src/classes/Commands/sub-classes/Manager.ts @@ -975,7 +975,7 @@ export default class ManagerCommands { await exec('npm run build'); this.bot.sendMessage(steamID, '⌛ Restarting...'); - return await this.bot.botManager.restartProcess(); + await this.bot.botManager.restartProcess(); } catch (err) { this.bot.sendMessage(steamID, `❌ Error while updating the bot: ${JSON.stringify(err)}`); // Bring back to online