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);});
|
|
@ -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');
|
||||
|
|
Loading…
Reference in New Issue