Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Tests n stuff

  • Loading branch information...
commit a7f88a20c1e86e045ad7982753c83d3b9c25410a 1 parent 889362a
zipp authored
Showing with 6 additions and 19 deletions.
  1. +1 −0  index.js
  2. +5 −19 tests/noob_client.js
View
1  index.js
@@ -87,6 +87,7 @@ zIRCClient.prototype.handle_command = function (message) {
/*
Server->Driver command handling
What to do when you get a command of case 'x' from the server
+ Based on numerics
*/
switch (message.command) {
case "PING":
View
24 tests/noob_client.js
@@ -10,23 +10,6 @@ zirc_client.on("connect", function () {
console.log('Connected to ' + zirc_client.host + ":" + zirc_client.port);
});
-// Client needs to emit..
-// join
-// leave
-// kick
-// invite
-// topic
-// mode
-// say
-// msg
-// notice
-// away
-// back
-// whois
-// register
-// setNick
-// quit
-
zirc_client.on("ready", function() {
console.log('READY!');
process.stdin.resume();
@@ -61,7 +44,7 @@ zirc_client.on("ready", function() {
case "msg":
var args = text.substring(text.indexOf(" ") + 1);
args = args.split(" ");
- zirc_client.msg(args.shift(), util.format(args.toString()));
+ zirc_client.msg(args.shift(), util.format(args.join(" ")));
break;
case "notice":
var args = text.substring(text.indexOf(" ") + 1);
@@ -115,5 +98,8 @@ zirc_client.on("PRIVMSG", function(msg) {
});
zirc_client.on("message", function(msg) {
- console.log(msg);
+ if (msg.command == 001) {
+ console.log(msg);
+ }
+ console.log(msg.args[msg.args.length - 1]);
});
Please sign in to comment.
Something went wrong with that request. Please try again.