Botflag & Tmpdir

This commit is contained in:
Flummi 2016-08-12 14:12:44 +02:00
parent cc55e93c65
commit 77341ec405
2 changed files with 11 additions and 3 deletions

0
b/.empty Normal file
View File

View File

@ -3,7 +3,7 @@ var request = require('request');
var mysql = require('mysql'); var mysql = require('mysql');
var bot = require('coffea')(); var bot = require('coffea')();
cfg.server.forEach((e,i,a)=>{ cfg.server.forEach((e,i,a) => {
bot.add({ bot.add({
"name": e.name, "name": e.name,
"host": e.host, "host": e.host,
@ -20,6 +20,7 @@ cfg.server.forEach((e,i,a)=>{
bot.on('motd', (e) => { bot.on('motd', (e) => {
console.log("motd von "+e.network+" erhalten"); console.log("motd von "+e.network+" erhalten");
bot.write('MODE f0ck +B', e.network, (c)=>{}); // Botflag
//if(g_server[e.network].channels.length > 0) { //if(g_server[e.network].channels.length > 0) {
// bot.join( JSON.parse( g_server[e.network].channels ) ); // bot.join( JSON.parse( g_server[e.network].channels ) );
//} //}
@ -29,11 +30,18 @@ bot.on('message', (e) => {
var orig = e.message; var orig = e.message;
if(e.channel.getName().toString() == "#f0ck") { if(e.channel.getName().toString() == "#f0ck") {
/*var u = "f0ck";
bot.whois(u, e.network, (m)=>{ });
setTimeout(() => {
var user = bot.getUser(u, e.network);
e.reply(user);
}, 2000);*/
if(orig.match(/(https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi)) { if(orig.match(/(https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi)) {
var tmp = orig.match(/(https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi); var tmp = orig.match(/(https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi);
e.reply(tmp); e.reply(tmp);
console.log(tmp);
} }
} }