rm index.js

This commit is contained in:
Lamp 2018-07-13 20:45:51 -07:00
parent 41e395821b
commit d81653d944
No known key found for this signature in database
GPG Key ID: 0F1F8704BEDE369E
4 changed files with 11 additions and 15 deletions

1
.gitignore vendored
View File

@ -2,3 +2,4 @@
node_modules/
.DS_Store
test.sh
.vscode

View File

@ -1 +1 @@
worker: node index.js
worker: node src/main.js

View File

@ -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);});

View File

@ -6,11 +6,16 @@ global.Discord = require('discord.js');
global.fs = require('fs');
global.dClient = new Discord.Client({ disableEveryone: true });
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', () => {
console.log('Discord Client Ready');