umode trigger
This commit is contained in:
parent
01b74af135
commit
9bfd49d04f
26
src/trigger/umode.js
Normal file
26
src/trigger/umode.js
Normal file
|
@ -0,0 +1,26 @@
|
|||
module.exports = (bot, trigger, lib) => {
|
||||
trigger.add({
|
||||
name: 'umode',
|
||||
call: /^\!umode (.*)/i,
|
||||
level: 100,
|
||||
active: 1,
|
||||
func: (e) => {
|
||||
var modes = e.message.split(' ');
|
||||
var user = modes[modes.length - 1];
|
||||
if(user.match(/(\+|-)/))
|
||||
user = e.user.getNick();
|
||||
else
|
||||
modes.pop();
|
||||
modes.shift();
|
||||
|
||||
if(modes.length > 0) {
|
||||
modes.forEach((entry,i,a) => {
|
||||
bot.mode(e.channel, entry+' '+user, e.network);
|
||||
});
|
||||
}
|
||||
else
|
||||
e.reply('no modes given');
|
||||
},
|
||||
desc: 'change Usermodes'
|
||||
});
|
||||
};
|
Loading…
Reference in New Issue
Block a user