rm dat discord console sheit
This commit is contained in:
parent
084de94694
commit
2fd27fc5f1
20
src/main.js
20
src/main.js
|
@ -5,26 +5,6 @@ global.fs = require('fs');
|
|||
global.config = require('./config');
|
||||
global.dClient = new Discord.Client({ disableEveryone: true });
|
||||
|
||||
console._log = console.log;
|
||||
console.log = function(){
|
||||
console._log.apply(console, arguments);
|
||||
log2discord(arguments);
|
||||
}
|
||||
console._error = console.error;
|
||||
console.error = function(){
|
||||
console._error.apply(console, arguments);
|
||||
log2discord(arguments);
|
||||
}
|
||||
console.warn = console.error;
|
||||
console.info = console.log;
|
||||
|
||||
var webhook = new Discord.WebhookClient(config.webhooks.console[0], config.webhooks.console[1]);
|
||||
function log2discord(str){
|
||||
str = Array.from(str);
|
||||
str = str.map(require('util').inspect);
|
||||
str = str.join(' ');
|
||||
webhook.send(str, {split:{char:''}});
|
||||
}
|
||||
|
||||
process.on('unhandledRejection', (reason, promise) => {
|
||||
console.error(promise);
|
||||
|
|
Loading…
Reference in New Issue