part & join

This commit is contained in:
Flummi 2016-10-18 13:08:50 +02:00
parent 76bab388dd
commit c333fb4339
2 changed files with 34 additions and 0 deletions

22
src/trigger/join.js Normal file
View File

@ -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'
});
};

12
src/trigger/part.js Normal file
View File

@ -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'
});
};