diff --git a/exec/load/ircbot_commands.js b/exec/load/ircbot_commands.js index 5c25fb2f8866251a8fd06cb8c8b1943b1c3c298f..a408e63aecc149b55d7f386f5847293f04c89090 100644 --- a/exec/load/ircbot_commands.js +++ b/exec/load/ircbot_commands.js @@ -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; diff --git a/exec/load/ircbot_functions.js b/exec/load/ircbot_functions.js index b048ff5594cc67ff4a51c9f5892e11cc718f8430..45e5a885b637c5af84c6d0bc81cffa2eed7c7df3 100644 --- a/exec/load/ircbot_functions.js +++ b/exec/load/ircbot_functions.js @@ -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; }