mirror of
https://github.com/Expand-sys/mcbot
synced 2025-12-17 07:12:13 +11:00
changes to disable mongodb and reenable the restarter
This commit is contained in:
parent
88cfa63f5e
commit
c4cd201e06
3 changed files with 10 additions and 10 deletions
|
|
@ -24,7 +24,7 @@ async function run() {
|
||||||
await dbclient.close();
|
await dbclient.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
run().catch(console.dir);
|
//run().catch(console.dir);
|
||||||
|
|
||||||
count = 0
|
count = 0
|
||||||
|
|
||||||
|
|
@ -81,10 +81,10 @@ module.exports = {
|
||||||
if(serverofflinefor == 60 && restarted != 1){
|
if(serverofflinefor == 60 && restarted != 1){
|
||||||
channelSend(`Server Offline for 60 seconds Restarting`)
|
channelSend(`Server Offline for 60 seconds Restarting`)
|
||||||
//this is commented out temporarily to stop the server trying to start on my local machine but has been tested as working
|
//this is commented out temporarily to stop the server trying to start on my local machine but has been tested as working
|
||||||
//const killer = await spawn("screen", ['-XS', 'minecraft', 'quit'])
|
const killer = await spawn("tmux", ['kill-session', '-t', 'minecraft'])
|
||||||
//const mc = await spawn("screen", ['-dmS', 'minecraft', '/bin/bash', `${process.env.SERSTARTLOC}/ServerStart.sh`], {
|
const mc = await spawn("tmux", ['new', '-ds', 'minecraft', `${process.env.SERSTARTLOC}/run.sh`], {
|
||||||
//cwd: `${process.env.SERSTARTLOC}`
|
cwd: `${process.env.SERSTARTLOC}`
|
||||||
//})
|
})
|
||||||
restarted = 1
|
restarted = 1
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
|
||||||
8
index.js
8
index.js
|
|
@ -4,16 +4,16 @@ const Discord = require("discord.js");
|
||||||
|
|
||||||
const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers], partials: [Discord.Partials.Channel] });
|
const client = new Discord.Client({ intents: [Discord.GatewayIntentBits.Guilds, Discord.GatewayIntentBits.GuildMembers], partials: [Discord.Partials.Channel] });
|
||||||
|
|
||||||
const { MongoClient, ServerApiVersion } = require('mongodb');
|
//const { MongoClient, ServerApiVersion } = require('mongodb');
|
||||||
const uri = `${process.env.MONGOCONN}`;
|
//const uri = `${process.env.MONGOCONN}`;
|
||||||
// Create a MongoClient with a MongoClientOptions object to set the Stable API version
|
// Create a MongoClient with a MongoClientOptions object to set the Stable API version
|
||||||
const dbclient = new MongoClient(uri, {
|
/*const dbclient = new MongoClient(uri, {
|
||||||
serverApi: {
|
serverApi: {
|
||||||
version: ServerApiVersion.v1,
|
version: ServerApiVersion.v1,
|
||||||
strict: true,
|
strict: true,
|
||||||
deprecationErrors: true,
|
deprecationErrors: true,
|
||||||
}
|
}
|
||||||
});
|
});*/
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -19,7 +19,7 @@
|
||||||
"discord-api-types": "^0.20.2",
|
"discord-api-types": "^0.20.2",
|
||||||
"discord.js": "^14.7.0",
|
"discord.js": "^14.7.0",
|
||||||
"dotenv": "^9.0.2",
|
"dotenv": "^9.0.2",
|
||||||
"gamedig": "^4.3.0",
|
"gamedig": "^5.0.0-beta.2",
|
||||||
"gifencoder": "^2.0.1",
|
"gifencoder": "^2.0.1",
|
||||||
"glob": "^7.2.0",
|
"glob": "^7.2.0",
|
||||||
"mongodb": "^6.3.0",
|
"mongodb": "^6.3.0",
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue