1.7.1 Production improvments

This commit is contained in:
SowinskiBraeden committed 2021-09-27 10:26:35 -07:00
1 parent f45aaf664b
commit 8dac1d4262
4 files changed
+10 -11

No files matched your search

+2 -1
View File
@@ -5,4 +5,5 @@ node_modules/*
test.js test.js
# Dev version # Dev version
dev.js dev.js
dev-config.json
+5 -5
View File
@@ -6,16 +6,16 @@ const client = new Discord.Client();
class Bot { class Bot {
constructor(dev, token, config) { constructor(dev, token, config, mongoURI, dbo) {
this.dev = dev; this.dev = dev;
this.token = token; this.token = token;
this.config = require(config); this.config = require(config);
this.connectMongo(); this.connectMongo(mongoURI, dbo);
} }
async connectMongo() { async connectMongo(mongoURI, dbo) {
this.db = await MongoClient.connect(this.config.mongoURI,{useUnifiedTopology:true}); this.db = await MongoClient.connect(mongoURI,{useUnifiedTopology:true});
this.dbo = this.db.db(this.config.dbo); this.dbo = this.db.db(dbo);
} }
// Updates Prefix // Updates Prefix
+2 -4
View File
@@ -1,8 +1,6 @@
{ {
"defaultPrefix": "?", "defaultPrefix": "?",
"botID": "860298681047056434", "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", "version": "Beta 1.7.0",
"socket": "https://police-cad-dev.herokuapp.com/", "socket": "https://police-cad-dev.herokuapp.com/"
"dbo": "heroku_8pc4g86l" }
}
+1 -1
View File
@@ -1,4 +1,4 @@
const Bot = require('./LPS').Bot; 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() client.main()