From d01b3de6317b25e1336c0cabfcac3e3d86314bd3 Mon Sep 17 00:00:00 2001 From: Braeden Sowinski Date: Sun, 9 Apr 2023 21:53:23 -0700 Subject: [PATCH] debug new db connection --- package.json | 2 +- structures/DayzArmbands.js | 7 ++++++- 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/package.json b/package.json index 678812c..3775135 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "dayz-armbands", - "version": "6.3.6", + "version": "6.3.7", "description": "A General Purpose Discord Bot for DayZ Servers.", "main": "index.js", "nodemonConfig": { diff --git a/structures/DayzArmbands.js b/structures/DayzArmbands.js index 0822541..98a4154 100644 --- a/structures/DayzArmbands.js +++ b/structures/DayzArmbands.js @@ -200,7 +200,12 @@ class DayzArmbands extends Client { // Connect to Mongo database. this.db = await MongoClient.connect(mongoURI, {connectTimeoutMS: 1000}); this.dbo = this.db.db(dbo); - mongoose.connect(`${mongoURI}/${dbo}`); + mongoose.connect(`mongodb://${mongoURI.split('@')[1]}/${dbo}`, { + authSource: "admin", + user: mongoURI.split('//')[1].split(':')[0], + pass: mongoURI.split('//')[1].split(':')[1].split('@')[0], + useNewUrlParser: true, + }).catch(e=>this.error(e)); this.log('Successfully connected to mongoDB'); databaselogs.connected = true; databaselogs.attempts = 0; // reset attempts