f0ckv1/src/trigger/umode.js

28 lines
745 B
JavaScript
Raw Normal View History

2016-09-05 11:18:58 +00:00
module.exports = (bot, trigger, lib) => {
trigger.add({
name: 'umode',
call: /^\!umode (.*)/i,
level: 100,
active: 1,
func: (e) => {
2016-09-05 17:54:09 +00:00
var modes = e.message.trim().split(' ');
2016-09-05 11:18:58 +00:00
var user = modes[modes.length - 1];
2016-09-05 11:25:29 +00:00
if(user.toLowerCase() != bot.me.nick.toLowerCase()) {
2016-09-05 11:21:52 +00:00
if(user.match(/(\+|-)/))
user = e.user.getNick();
else
modes.pop();
modes.shift();
2016-09-05 17:54:09 +00:00
if(modes.length > 0)
2016-09-05 11:21:52 +00:00
modes.forEach((entry,i,a) => {
bot.mode(e.channel, entry+' '+user, e.network);
});
else
e.reply('no modes given');
2016-09-05 11:18:58 +00:00
}
else
2016-09-05 11:21:52 +00:00
e.reply('f0ck you.');
2016-09-05 11:18:58 +00:00
},
desc: 'change Usermodes'
});
};