rm index.js
This commit is contained in:
parent
41e395821b
commit
d81653d944
|
@ -2,3 +2,4 @@
|
|||
node_modules/
|
||||
.DS_Store
|
||||
test.sh
|
||||
.vscode
|
||||
|
|
10
index.js
10
index.js
|
@ -1,10 +0,0 @@
|
|||
(async function(){
|
||||
global.dbClient = new (require('pg').Client)({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
ssl: true,
|
||||
});
|
||||
await dbClient.connect();
|
||||
|
||||
require('./src/main');
|
||||
|
||||
})().catch(error => {console.error(error.stack); process.exit(1);});
|
13
src/main.js
13
src/main.js
|
@ -6,10 +6,15 @@ global.Discord = require('discord.js');
|
|||
global.fs = require('fs');
|
||||
global.dClient = new Discord.Client({ disableEveryone: true });
|
||||
|
||||
|
||||
(require('mongodb').MongoClient).connect(config.MONGODB_URI).then(client=>{
|
||||
global.mdbClient = client;
|
||||
dClient.login(config.DISCORD_TOKEN);
|
||||
global.dbClient = new (require('pg').Client)({
|
||||
connectionString: process.env.DATABASE_URL,
|
||||
ssl: !config.testmode,
|
||||
});
|
||||
dbClient.connect().then(function(){
|
||||
(require('mongodb').MongoClient).connect(config.MONGODB_URI).then(client=>{
|
||||
global.mdbClient = client;
|
||||
dClient.login(config.DISCORD_TOKEN);
|
||||
});
|
||||
});
|
||||
|
||||
dClient.once('ready', () => {
|
||||
|
|
Loading…
Reference in New Issue