buggsenfiggs

This commit is contained in:
Flummi 2016-08-23 17:36:16 +00:00
parent f1ce2ebc75
commit eb1aa8edaa
3 changed files with 44 additions and 41 deletions

View File

@ -19,7 +19,7 @@ var haDC = () => {
haDC(); haDC();
var lib = new Lib(bot, sql, cfg); var lib = new Lib(bot, sql, cfg);
var websrv = new Websrv(bot, sql, cfg); var websrv = new Websrv(bot, sql, cfg, lib);
cfg.server.forEach((e,i,a) => { cfg.server.forEach((e,i,a) => {
bot.add({ bot.add({

View File

@ -8,6 +8,7 @@ module.exports = (bot, trigger, lib) => {
call: new RegExp('https?:\\/\\/[\\w-]+(\\.[\\w-]+)+\\.?(:\\d+)?(\\/\\S*)?', 'gi'), call: new RegExp('https?:\\/\\/[\\w-]+(\\.[\\w-]+)+\\.?(:\\d+)?(\\/\\S*)?', 'gi'),
level: 0, level: 0,
func: (e) => { func: (e) => {
if(e.channel.getName() != '#f0ck') {
if(!e.message.match(/\!ignore$/)) { if(!e.message.match(/\!ignore$/)) {
var tmp = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links var tmp = e.message.match(/https?:\/\/[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); // get links
tmp.forEach((entry,i,a) => { tmp.forEach((entry,i,a) => {
@ -50,6 +51,7 @@ module.exports = (bot, trigger, lib) => {
}); });
}); });
} }
}
}, },
desc: 'muh' desc: 'muh'
}); });

View File

@ -4,13 +4,14 @@ var path = require('path');
var swig = require('swig'); var swig = require('swig');
var templates = {}; var templates = {};
var bot, sql, cfg; var bot, sql, cfg, lib;
module.exports = Websrv; module.exports = Websrv;
function Websrv(tbot, tsql, tcfg) { function Websrv(tbot, tsql, tcfg, tlib) {
this.bot = bot = tbot; this.bot = bot = tbot;
this.sql = sql = tsql; this.sql = sql = tsql;
this.cfg = cfg = tcfg; this.cfg = cfg = tcfg;
this.lib = lib = tlib;
http.createServer((req, res) => { http.createServer((req, res) => {
if(cfg.wlip.hasOwnProperty(req.connection.remoteAddress)) { if(cfg.wlip.hasOwnProperty(req.connection.remoteAddress)) {