user is now guaranteed to be in the channel, so...

This commit is contained in:
jkhsjdhjs 2016-09-06 03:57:49 +02:00
parent 4ebbcd1955
commit 4c5bd3dd1d

View File

@ -18,20 +18,16 @@ module.exports = (bot, trigger, lib) => {
tmp.pop();
var modes;
if(user.toLowerCase() != bot.me.nick.toLowerCase()) {
if(user in e.channel.names) {
if(modes = processModes(tmp.join(' '))) {
if(checkModes(modes.give + modes.revoke, allowedModes)) {
if(modes.give != "") bot.mode(e.channel, '+' + modes.give + ' ' + (user+' ').repeat(modes.give.length), e.network);
if(modes.revoke != "") bot.mode(e.channel, '-' + modes.revoke + ' ' + (user+' ').repeat(modes.revoke.length), e.network);
}
else
e.reply('Error! Allowed modes are: ' + allowedModes.join(','));
if(modes = processModes(tmp.join(' '))) {
if(checkModes(modes.give + modes.revoke, allowedModes)) {
if(modes.give != "") bot.mode(e.channel, '+' + modes.give + ' ' + (user+' ').repeat(modes.give.length), e.network);
if(modes.revoke != "") bot.mode(e.channel, '-' + modes.revoke + ' ' + (user+' ').repeat(modes.revoke.length), e.network);
}
else
e.reply('Syntax Error!');
e.reply('Error! Allowed modes are: ' + allowedModes.join(','));
}
else
e.reply('user '+user+' not found!');
e.reply('Syntax Error!');
}
else
e.reply('f0ck you hard');