part & join
This commit is contained in:
parent
76bab388dd
commit
c333fb4339
22
src/trigger/join.js
Normal file
22
src/trigger/join.js
Normal 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
12
src/trigger/part.js
Normal 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'
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user