modified: src/trigger/umode.js
This commit is contained in:
parent
e90aaf0cb6
commit
619e225544
|
@ -5,18 +5,27 @@ module.exports = (bot, trigger, lib) => {
|
||||||
level: 100,
|
level: 100,
|
||||||
active: 1,
|
active: 1,
|
||||||
func: (e) => {
|
func: (e) => {
|
||||||
|
var allowedModes = [
|
||||||
|
'q','a','o','h','v'
|
||||||
|
];
|
||||||
var modes = e.message.trim().split(' ');
|
var modes = e.message.trim().split(' ');
|
||||||
var user = modes[modes.length - 1];
|
var user = modes[modes.length - 1];
|
||||||
if(user.toLowerCase() != bot.me.nick.toLowerCase()) {
|
if(user.toLowerCase() != bot.me.nick.toLowerCase()) {
|
||||||
if(user.match(/(\+|-)/))
|
if(user.match(/(\+|-)/))
|
||||||
user = e.user.getNick();
|
user = e.user.getNick();
|
||||||
else
|
|
||||||
modes.pop();
|
|
||||||
modes.shift();
|
modes.shift();
|
||||||
if(modes.length > 0)
|
var tmp = [];
|
||||||
modes.forEach((entry,i,a) => {
|
modes.forEach((entry,i,a) => {
|
||||||
|
if(entry.match(/((\+|-)[a-z]{1}$)/))
|
||||||
|
tmp.push(entry);
|
||||||
|
});
|
||||||
|
|
||||||
|
if(tmp.length > 0) {
|
||||||
|
e.reply('modes: '+JSON.stringify(tmp) + ' to user: '+user);
|
||||||
|
tmp.forEach((entry,i,a) => {
|
||||||
bot.mode(e.channel, entry+' '+user, e.network);
|
bot.mode(e.channel, entry+' '+user, e.network);
|
||||||
});
|
});
|
||||||
|
}
|
||||||
else
|
else
|
||||||
e.reply('no modes given');
|
e.reply('no modes given');
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user