From d4e38871483ec8d2a96a6948b864d2c79dcca429 Mon Sep 17 00:00:00 2001 From: Flummi Date: Fri, 28 Jul 2017 10:34:37 +0200 Subject: [PATCH] alles Mist. --- src/events/message.js | 2 +- src/trigger/f0ckfav.js | 22 ++++++++++++++++++++++ 2 files changed, 23 insertions(+), 1 deletion(-) create mode 100644 src/trigger/f0ckfav.js diff --git a/src/events/message.js b/src/events/message.js index 8210483..8485c80 100644 --- a/src/events/message.js +++ b/src/events/message.js @@ -1,6 +1,6 @@ module.exports = (lib) => { lib.bot.on('message', (e) => { - lib.trigger.trigger.forEach((entry,i,a) => { + lib.trigger.trigger.forEach(entry => { if(e.message.match(entry.call)) { let active = false; if(lib.cfg.trigger[e.network+e.channel.getName()] !== undefined) { diff --git a/src/trigger/f0ckfav.js b/src/trigger/f0ckfav.js new file mode 100644 index 0000000..b90b446 --- /dev/null +++ b/src/trigger/f0ckfav.js @@ -0,0 +1,22 @@ +module.exports = (lib) => { + lib.trigger.add({ + name: 'f0ckfav', + call: /^\!f0ckfav .*/, + level: 0, + active: 0, + func: (e) => { + // !f0ckfav f0cklink/id // fav hinzufuegen + // !f0ckfav user // favlink ausgeben ( https://f0ck.me/u/$user/favs ) + let arg = e.message.trim().split(" ")[1]; + e.reply(arg); + + if(arg.match(/https:\/\/f0ck.me\/(\d+)/)) { + e.reply("Link"); + } + else { + e.reply("User / ungueltig"); + } + }, + desc: 'f0ckfav' + }); +}; \ No newline at end of file