This commit is contained in:
parent
e2311e8c1f
commit
493830aeeb
11
src/main.js
11
src/main.js
|
@ -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);
|
||||||
|
|
|
@ -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)]
|
||||||
}
|
}
|
Loading…
Reference in New Issue