modified: package.json

modified:   src/main.js
This commit is contained in:
Flummi 2016-08-11 14:38:07 +02:00
parent f1c0139b7f
commit a4a7e6cac2
2 changed files with 14 additions and 3 deletions

View File

@ -4,7 +4,9 @@
"main": "src/main.js", "main": "src/main.js",
"dependencies": { "dependencies": {
"coffea": "^0.4.24", "coffea": "^0.4.24",
"repl": "^0.1.3" "repl": "^0.1.3",
"request": "^2.74.0",
"mysql": "^2.11.1"
}, },
"repository": { "repository": {
"type": "git", "type": "git",

View File

@ -1,4 +1,6 @@
var cfg = require('../../cfg.json'); var cfg = require('../../cfg.json');
var request = require('request');
var mysql = require('mysql');
var bot = require('coffea')(); var bot = require('coffea')();
cfg.server.forEach((e,i,a)=>{ cfg.server.forEach((e,i,a)=>{
@ -25,7 +27,14 @@ bot.on('motd', (e) => {
bot.on('message', (e) => { bot.on('message', (e) => {
var orig = e.message; var orig = e.message;
if(orig.match(/f0ck you/i)) {
e.reply("no, f0ck you leatherman!"); if(e.channel.getName().toString() == "#f0ck") {
if(orig.match(/(https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi)) {
var tmp = orig.match(/(https?:\/\/)?[\w-]+(\.[\w-]+)+\.?(:\d+)?(\/\S*)?/gi);
e.reply(tmp);
console.log(tmp);
}
} }
}); });