f0ckv1/src/trigger/umode.js
2016-09-05 11:25:29 +00:00

29 lines
751 B
JavaScript

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.toLowerCase() != bot.me.nick.toLowerCase()) {
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');
}
else
e.reply('f0ck you.');
},
desc: 'change Usermodes'
});
};