This commit is contained in:
Lamp 2018-07-13 20:29:41 -07:00
parent e2311e8c1f
commit 493830aeeb
No known key found for this signature in database
GPG Key ID: 0F1F8704BEDE369E
2 changed files with 9 additions and 9 deletions

View File

@ -1,19 +1,12 @@
require('./util'); require('./util');
global.config = require('./config');
if (config.testmode) console.log('TEST MODE');
global.exitHook = require('async-exit-hook'); global.exitHook = require('async-exit-hook');
global.Discord = require('discord.js'); global.Discord = require('discord.js');
global.fs = require('fs'); global.fs = require('fs');
global.config = require('./config');
global.dClient = new Discord.Client({ disableEveryone: true }); global.dClient = new Discord.Client({ disableEveryone: true });
process.on('unhandledRejection', (reason, promise) => {
console.error(promise);
});
process.on('uncaughtException', error => {
console.error(error.stack);
});
(require('mongodb').MongoClient).connect(config.MONGODB_URI).then(client=>{ (require('mongodb').MongoClient).connect(config.MONGODB_URI).then(client=>{
global.mdbClient = client; global.mdbClient = client;
dClient.login(config.DISCORD_TOKEN); dClient.login(config.DISCORD_TOKEN);

View File

@ -1,3 +1,10 @@
process.on('unhandledRejection', (reason, promise) => {
console.error(promise);
});
process.on('uncaughtException', error => {
console.error(error.stack);
});
Array.prototype.random = function () { Array.prototype.random = function () {
return this[Math.floor(Math.random() * this.length)] return this[Math.floor(Math.random() * this.length)]
} }