From ead508ebc902509c03ec93672fa724425360269a Mon Sep 17 00:00:00 2001 From: ShadowVR Date: Fri, 31 May 2024 17:09:03 -0400 Subject: [PATCH] revert 2a14a78fbf697b4b5c5915a61110cfd6e2b39c36 revert Updated index.js --- index.js | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index d561b06..0198f61 100644 --- a/index.js +++ b/index.js @@ -72,7 +72,9 @@ async function registerSlashCommands() { // Call the async function to register slash commands registerSlashCommands(); +// Function to update the bot from GitHub repository async function updateBotFromGitHub() { + const git = simpleGit(path.resolve(__dirname)); try { @@ -80,12 +82,9 @@ async function updateBotFromGitHub() { if (!await git.checkIsRepo()) { await git.init().addRemote('origin', 'https://git.shadowhosting.xyz/shadowvr/AI_botter.git').fetch(); - } else { - await git.fetch('origin', 'main'); } - // Force update by resetting to the latest commit on the remote main branch - await git.reset(['--hard', 'origin/main']); + await git.pull('origin', 'main'); console.log('Bot updated from GitHub.');