From c4cd201e06a89a445171910494e115019b990665 Mon Sep 17 00:00:00 2001 From: Expand-sys Date: Thu, 8 Feb 2024 15:30:56 +1100 Subject: [PATCH] changes to disable mongodb and reenable the restarter --- events/client/ready.js | 10 +++++----- index.js | 8 ++++---- package.json | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/events/client/ready.js b/events/client/ready.js index ef7d134..4a7bb5f 100644 --- a/events/client/ready.js +++ b/events/client/ready.js @@ -24,7 +24,7 @@ async function run() { await dbclient.close(); } } -run().catch(console.dir); +//run().catch(console.dir); count = 0 @@ -81,10 +81,10 @@ module.exports = { if(serverofflinefor == 60 && restarted != 1){ 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 - //const killer = await spawn("screen", ['-XS', 'minecraft', 'quit']) - //const mc = await spawn("screen", ['-dmS', 'minecraft', '/bin/bash', `${process.env.SERSTARTLOC}/ServerStart.sh`], { - //cwd: `${process.env.SERSTARTLOC}` - //}) + const killer = await spawn("tmux", ['kill-session', '-t', 'minecraft']) + const mc = await spawn("tmux", ['new', '-ds', 'minecraft', `${process.env.SERSTARTLOC}/run.sh`], { + cwd: `${process.env.SERSTARTLOC}` + }) restarted = 1 } }); diff --git a/index.js b/index.js index 667d20c..ff2b251 100644 --- a/index.js +++ b/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 { MongoClient, ServerApiVersion } = require('mongodb'); -const uri = `${process.env.MONGOCONN}`; +//const { MongoClient, ServerApiVersion } = require('mongodb'); +//const uri = `${process.env.MONGOCONN}`; // Create a MongoClient with a MongoClientOptions object to set the Stable API version -const dbclient = new MongoClient(uri, { +/*const dbclient = new MongoClient(uri, { serverApi: { version: ServerApiVersion.v1, strict: true, deprecationErrors: true, } -}); +});*/ diff --git a/package.json b/package.json index e39b7d1..8982924 100644 --- a/package.json +++ b/package.json @@ -19,7 +19,7 @@ "discord-api-types": "^0.20.2", "discord.js": "^14.7.0", "dotenv": "^9.0.2", - "gamedig": "^4.3.0", + "gamedig": "^5.0.0-beta.2", "gifencoder": "^2.0.1", "glob": "^7.2.0", "mongodb": "^6.3.0",