Skip to content

Commit

Permalink
aucgbot: onUnknownCmd
Browse files Browse the repository at this point in the history
  • Loading branch information
auscompgeek committed Dec 12, 2015
1 parent 4d132f7 commit aa359d0
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions aucgbot.js
Original file line number Diff line number Diff line change
Expand Up @@ -537,7 +537,7 @@ aucgbot.parseCmd = function parseCmd(e, cmdMsg) {
if (!match || !match[1]) {
return;
}
let cmd = (e.cmd = match[1].toLowerCase());
let cmd = (e.cmd = match[1]).toLowerCase();
let args = (e.args = match[2] || "");
let dest = e.dest, nick = e.nick, host = e.host, conn = e.conn, relay = e.relay;
switch (cmd) {
Expand Down Expand Up @@ -617,10 +617,17 @@ aucgbot.parseCmd = function parseCmd(e, cmdMsg) {
break;
default:
try {
this.modMethod("parseCmd", arguments) || this.modMethod("cmd_" + cmd, arguments);
if (this.modMethod("parseCmd", arguments) || this.modMethod("cmd_" + cmd, arguments))
return;
} catch (ex) {
e.notice("Oops, I encountered an error.", ex);
e.logError("command", ex, nick + (dest === nick ? "" : " in " + dest), cmd, args);
return;
}
try {
this.modMethod("onUnknownCmd", arguments);
} catch (ex) {
e.logError("unknown command", ex, nick, cmd, args);
}
}
};
Expand Down

0 comments on commit aa359d0

Please sign in to comment.