better error handling

This commit is contained in:
jkhsjdhjs 2016-09-06 14:12:36 +02:00
parent d845de1e02
commit 4327fd983b

View File

@ -18,7 +18,8 @@ module.exports = (bot, trigger, lib) => {
tmp.pop();
var modes;
if(user.toLowerCase() != bot.me.nick.toLowerCase()) {
if(modes = processModes(tmp.join(''))) {
var modes = processModes(tmp.join(''));
if(modes.length) {
if(checkModes(modes, allowedModes)) {
var modesToApply = [], currentPrefix, queuedModes;
while(modes.length) {
@ -37,7 +38,7 @@ module.exports = (bot, trigger, lib) => {
e.reply('Error! Allowed modes are: ' + allowedModes.join(','));
}
else
e.reply('Syntax Error!');
e.reply('No modes specified!');
}
else
e.reply('f0ck you hard');