revert Updated index.js
This commit is contained in:
ShadowVR 2024-05-31 17:09:03 -04:00
parent 6faa6aa040
commit ead508ebc9

View file

@ -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.');