parent
6faa6aa040
commit
ead508ebc9
1 changed files with 3 additions and 4 deletions
7
index.js
7
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.');
|
||||
|
||||
|
|
Loading…
Reference in a new issue