From 0621234e5087e85482dd0db18ade0fed15663aa8 Mon Sep 17 00:00:00 2001 From: Flummi Date: Mon, 29 Aug 2016 22:30:36 +0200 Subject: [PATCH] sorted initfuncs --- src/lib.js | 4 ++++ src/main.js | 7 +------ src/websrv.js | 2 ++ 3 files changed, 7 insertions(+), 6 deletions(-) diff --git a/src/lib.js b/src/lib.js index a109fcf..656cdb3 100644 --- a/src/lib.js +++ b/src/lib.js @@ -15,6 +15,10 @@ function Lib(tbot, tsql) { this.sql = sql = tsql; this.debug = debug = false; this.admins = []; + + Lib.prototype.loadUser((cb) => { + console.log((cb)?"Admins wurden geladen":"Admins konnten nicht geladen werden"); + }); } Lib.prototype.getUser = (e, cbgu) => { diff --git a/src/main.js b/src/main.js index 8ab875b..be9d19b 100644 --- a/src/main.js +++ b/src/main.js @@ -53,11 +53,6 @@ bot.on('message', (e) => { }); }); -lib.loadUser((cb)=>{ - console.log((cb)?"Admins wurden geladen":"Admins konnten nicht geladen werden"); -}); -websrv.getTpls(); - var trigger = { trigger: [], add: (args) => { @@ -74,7 +69,7 @@ var trigger = { var loadPlugins = () => { var files = fs.readdirSync(__dirname+'/trigger/'); - files.forEach(function (file) { + files.forEach((file) => { if(file.substr(-3, 3) === '.js') { console.log('Loading plugin', file); require(__dirname+'/trigger/' + file)(bot, trigger, lib); diff --git a/src/websrv.js b/src/websrv.js index c746b80..2a66a1f 100644 --- a/src/websrv.js +++ b/src/websrv.js @@ -13,6 +13,8 @@ function Websrv(tbot, tsql, tlib) { this.sql = sql = tsql; this.lib = lib = tlib; + Websrv.prototype.getTpls(); + http.createServer((req, res) => { if(cfg.wlip.hasOwnProperty(req.connection.remoteAddress)) { var filePath = '.' + req.url;