Combine if statements to reduce nesting

This commit is contained in:
realies 2017-10-04 13:31:02 +03:00
parent 3244ec91e8
commit 960a6d42e1

View File

@ -187,10 +187,8 @@ $(function() {
if (text.indexOf("/") === 0) { if (text.indexOf("/") === 0) {
const args = text.substr(1).split(" "); const args = text.substr(1).split(" ");
const cmd = args.shift().toLowerCase(); const cmd = args.shift().toLowerCase();
if (typeof utils.inputCommands[cmd] === "function") { if (typeof utils.inputCommands[cmd] === "function" && utils.inputCommands[cmd](args)) {
if (utils.inputCommands[cmd](args)) { return;
return;
}
} }
} }