From c333fb43390d7e9d38033a5aed50e749c9ec9b9d Mon Sep 17 00:00:00 2001 From: Flummi Date: Tue, 18 Oct 2016 13:08:50 +0200 Subject: [PATCH] part & join --- src/trigger/join.js | 22 ++++++++++++++++++++++ src/trigger/part.js | 12 ++++++++++++ 2 files changed, 34 insertions(+) create mode 100644 src/trigger/join.js create mode 100644 src/trigger/part.js diff --git a/src/trigger/join.js b/src/trigger/join.js new file mode 100644 index 0000000..b122eff --- /dev/null +++ b/src/trigger/join.js @@ -0,0 +1,22 @@ +module.exports = (lib) => { + lib.trigger.add({ + name: 'join', + call: /^!join (#.*)/i, + level: 100, + active: 1, + func: (e) => { + let args = e.message.split(' '); + args.shift(); + var joins = []; + args.forEach(channel => { + channel = channel.trim(); + if(channel.charAt(0) === "#") { + joins.push(channel); + } + }); + lib.bot.join(joins, e.network); + e.reply("joined channels: "+joins.join(", ")); + }, + desc: 'join channel' + }); +}; \ No newline at end of file diff --git a/src/trigger/part.js b/src/trigger/part.js new file mode 100644 index 0000000..c97feb1 --- /dev/null +++ b/src/trigger/part.js @@ -0,0 +1,12 @@ +module.exports = (lib) => { + lib.trigger.add({ + name: 'part', + call: /^!part/i, + level: 100, + active: 1, + func: (e) => { + lib.bot.part(e.channel.getName(), "f0ck you leatherman", e.network); + }, + desc: 'parts channel' + }); +}; \ No newline at end of file