Skip to content
Snippets Groups Projects
Commit 1c9c5a68 authored by deuce's avatar deuce
Browse files

Deal with non-present nick.

parent 7443cea6
No related branches found
No related tags found
No related merge requests found
...@@ -15,6 +15,10 @@ Bot_Commands["WEATHER"].command = function (target,onick,ouh,srv,lvl,cmd) { ...@@ -15,6 +15,10 @@ Bot_Commands["WEATHER"].command = function (target,onick,ouh,srv,lvl,cmd) {
cmd.shift(); cmd.shift();
if(cmd[0]) if(cmd[0])
nick=cmd[0]; nick=cmd[0];
if(srv.users[nick.toUpperCase()] == undefined) {
srv.o(target, nick+', who the f^@% is '+nick+"?");
}
else {
lstr=get_nicklocation(srv.users[nick.toUpperCase()].uh, srv.users[nick.toUpperCase()].servername, nick); lstr=get_nicklocation(srv.users[nick.toUpperCase()].uh, srv.users[nick.toUpperCase()].servername, nick);
if (!lstr) { if (!lstr) {
var usr = new User(system.matchuser(nick)); var usr = new User(system.matchuser(nick));
...@@ -73,6 +77,7 @@ Bot_Commands["WEATHER"].command = function (target,onick,ouh,srv,lvl,cmd) { ...@@ -73,6 +77,7 @@ Bot_Commands["WEATHER"].command = function (target,onick,ouh,srv,lvl,cmd) {
break; break;
} }
}
return true; return true;
} }
......
...@@ -27,6 +27,10 @@ Bot_Commands["WHEREIS"].command = function (target,onick,ouh,srv,lvl,cmd) { ...@@ -27,6 +27,10 @@ Bot_Commands["WHEREIS"].command = function (target,onick,ouh,srv,lvl,cmd) {
return true; return true;
} }
if(srv.users[find.toUpperCase()] == undefined) {
lstr=find+', who the f^@% is '+find+"?";
}
else {
location=get_nicklocation(srv.users[find.toUpperCase()].uh, srv.users[find.toUpperCase()].servername, find); location=get_nicklocation(srv.users[find.toUpperCase()].uh, srv.users[find.toUpperCase()].servername, find);
if (location) { if (location) {
lstr=find+' is '; lstr=find+' is ';
...@@ -50,6 +54,7 @@ Bot_Commands["WHEREIS"].command = function (target,onick,ouh,srv,lvl,cmd) { ...@@ -50,6 +54,7 @@ Bot_Commands["WHEREIS"].command = function (target,onick,ouh,srv,lvl,cmd) {
if(!lstr) if(!lstr)
lstr="Unable to locate "+find; lstr="Unable to locate "+find;
}
srv.o(target, lstr); srv.o(target, lstr);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment