This commit is contained in:
parent
e2311e8c1f
commit
493830aeeb
11
src/main.js
11
src/main.js
|
@ -1,19 +1,12 @@
|
|||
require('./util');
|
||||
global.config = require('./config');
|
||||
if (config.testmode) console.log('TEST MODE');
|
||||
global.exitHook = require('async-exit-hook');
|
||||
global.Discord = require('discord.js');
|
||||
global.fs = require('fs');
|
||||
global.config = require('./config');
|
||||
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=>{
|
||||
global.mdbClient = client;
|
||||
dClient.login(config.DISCORD_TOKEN);
|
||||
|
|
|
@ -1,3 +1,10 @@
|
|||
process.on('unhandledRejection', (reason, promise) => {
|
||||
console.error(promise);
|
||||
});
|
||||
process.on('uncaughtException', error => {
|
||||
console.error(error.stack);
|
||||
});
|
||||
|
||||
Array.prototype.random = function () {
|
||||
return this[Math.floor(Math.random() * this.length)]
|
||||
}
|
Loading…
Reference in New Issue