sorted initfuncs

This commit is contained in:
Flummi 2016-08-29 22:30:36 +02:00
parent 7d92d23718
commit 0621234e50
3 changed files with 7 additions and 6 deletions

View File

@ -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) => {

View File

@ -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);

View File

@ -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;