Skip to content
Snippets Groups Projects
Commit ed12e49a authored by mcmlxxix's avatar mcmlxxix
Browse files

added detailed error reporting, fixed privmsg error, added "nick" bot command

parent 8cdf55c3
Branches
Tags
No related merge requests found
......@@ -290,6 +290,16 @@ Bot_Commands["PREFIX"].command = function (target,onick,ouh,srv,lvl,cmd) {
return;
}
Bot_Commands["NICK"] = new Bot_Command(80,1,true);
Bot_Commands["NICK"].command = function (target,onick,ouh,srv,lvl,cmd) {
cmd.shift();
if (cmd[0]) {
srv.writeout("NICK " + cmd[0]);
srv.curnick = cmd[0];
}
return;
}
Bot_Commands["MODE"] = new Bot_Command(80,true,true);
Bot_Commands["MODE"].usage =
get_cmd_prefix() + "MODE [ALL or #<chan> #<chan>...] [+/-ALL or +/-<module> +/-<module>...], " +
......@@ -605,7 +615,10 @@ Server_Commands["KICK"] = function (srv,cmd,onick,ouh) {
}
Server_Commands["PRIVMSG"] = function (srv,cmd,onick,ouh) {
if(srv.users[onick.toUpperCase()]) srv.users[onick.toUpperCase()].last_spoke=time();
if(!srv.users[onick.toUpperCase()])
srv.users[onick.toUpperCase()] = new Server_User(ouh,onick);
srv.users[onick.toUpperCase()].last_spoke=time();
if (cmd[0][0] == "#" || cmd[0][0] == "&") {
var chan=srv.channel[cmd[0].toUpperCase()];
if(!chan) return;
......
......@@ -77,7 +77,7 @@ function Server_CTCP(onick,ouh,cmd) {
break;
case "VERSION":
this.ctcp_reply(onick, "VERSION "
+ "Synchronet IRC Bot by Randy E. Sommerfeld <cyan@rrx.ca>, Module system by Matt D. Johnson <mdj1979@gmail.com>");
+ "Synchronet IRC Bot by Randy E. Sommerfeld <cyan@rrx.ca> & Matt D. Johnson <mdj1979@gmail.com>");
break;
case "FINGER":
this.ctcp_reply(onick, "FINGER "
......@@ -119,7 +119,9 @@ function Server_bot_command(srv,bot_cmds,target,onick,ouh,cmdline) {
try {
botcmd.command(target,onick,ouh,srv,access_level,cmd);
} catch (err) {
srv.o(target,"ERROR: " + err)
srv.o(target,err);
srv.o(target,"file: " + err.fileName);
srv.o(target,"line: " + err.lineNumber);
}
return 1;
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment