Permalink
Browse files

ping event (closes #82)

  • Loading branch information...
1 parent c1b7028 commit ecec9809bd71c41f6d031b2e820e750c3e7ad46e @martynsmith committed Oct 25, 2012
Showing with 8 additions and 0 deletions.
  1. +7 −0 docs/API.rst
  2. +1 −0 lib/irc.js
View
@@ -283,6 +283,13 @@ Events
means that the notice comes from the server. See the `raw` event for details
on the `message` object.
+.. js:data:: 'ping'
+
+ `function (server) { }`
+
+ Emitted when a server PINGs the client. The client will automatically send a
+ PONG request just before this is emitted.
+
.. js:data:: 'pm'
`function (nick, text, message) { }`
View
@@ -115,6 +115,7 @@ function Client(server, nick, opt) {
break;
case "PING":
self.send("PONG", message.args[0]);
+ self.emit('ping', message.args[0]);
break;
case "NOTICE":
var from = message.nick;

0 comments on commit ecec980

Please sign in to comment.