diff --git a/package.json b/package.json index 78fea01..d0b4576 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,9 @@ "main": "src/main.js", "dependencies": { "coffea": "^0.4.24", - "repl": "^0.1.3" + "repl": "^0.1.3", + "request": "^2.74.0", + "mysql": "^2.11.1" }, "repository": { "type": "git", diff --git a/src/main.js b/src/main.js index cf07b76..4ae094c 100644 --- a/src/main.js +++ b/src/main.js @@ -1,4 +1,6 @@ var cfg = require('../../cfg.json'); +var request = require('request'); +var mysql = require('mysql'); var bot = require('coffea')(); cfg.server.forEach((e,i,a)=>{ @@ -25,7 +27,14 @@ bot.on('motd', (e) => { bot.on('message', (e) => { 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); + } + } }); \ No newline at end of file