diff --git a/.gitignore b/.gitignore index 362ef31..ad0f98c 100644 --- a/.gitignore +++ b/.gitignore @@ -5,4 +5,5 @@ node_modules/* test.js # Dev version -dev.js \ No newline at end of file +dev.js +dev-config.json diff --git a/LPS.js b/LPS.js index 29dd2b0..65518b6 100644 --- a/LPS.js +++ b/LPS.js @@ -6,16 +6,16 @@ const client = new Discord.Client(); class Bot { - constructor(dev, token, config) { + constructor(dev, token, config, mongoURI, dbo) { this.dev = dev; this.token = token; this.config = require(config); - this.connectMongo(); + this.connectMongo(mongoURI, dbo); } - async connectMongo() { - this.db = await MongoClient.connect(this.config.mongoURI,{useUnifiedTopology:true}); - this.dbo = this.db.db(this.config.dbo); + async connectMongo(mongoURI, dbo) { + this.db = await MongoClient.connect(mongoURI,{useUnifiedTopology:true}); + this.dbo = this.db.db(dbo); } // Updates Prefix diff --git a/config.json b/config.json index 8fe0ff8..9560593 100644 --- a/config.json +++ b/config.json @@ -1,8 +1,6 @@ { "defaultPrefix": "?", "botID": "860298681047056434", - "mongoURI": "mongodb+srv://lps_bot:ktSkHml2BU9EIQ0a@heroku-police-cad-dev.j7aom.mongodb.net/heroku_8pc4g86l?retryWrites=true&w=majority", "version": "Beta 1.7.0", - "socket": "https://police-cad-dev.herokuapp.com/", - "dbo": "heroku_8pc4g86l" -} \ No newline at end of file + "socket": "https://police-cad-dev.herokuapp.com/" +} diff --git a/index.js b/index.js index 4e8796b..8229c1a 100644 --- a/index.js +++ b/index.js @@ -1,4 +1,4 @@ const Bot = require('./LPS').Bot; -client = new Bot('PRODUCTION', process.env.token, './config'); +client = new Bot('PRODUCTION', process.env.token, './config', process.env.mongoURI, process.env.dbo); client.main()