Permalink
Browse files

Merge pull request #80 from aaronpk/names_listener

Adds 'names' listener to node bot with docs
  • Loading branch information...
2 parents 6b73aa7 + bd8f485 commit e1db1ba091d617e7d57ec8794d16e89e4385f502 @wraithan committed Apr 4, 2013
Showing with 32 additions and 0 deletions.
  1. +14 −0 bot.js
  2. +18 −0 docs/services_devel.rst
View
@@ -119,6 +119,20 @@ zenircbot = {
zenircbot.pub.publish('in', JSON.stringify(msg));
});
+ bot.addListener('names', function(channel, nicks) {
+ console.log('Names: '+channel);
+ console.log(nicks);
+ var msg = {
+ version: 1,
+ type: 'names',
+ data: {
+ channel: channel,
+ nicks: nicks
+ }
+ };
+ zenircbot.pub.publish('in', JSON.stringify(msg));
+ });
+
bot.addListener('error', function(message) {
console.log(message);
});
@@ -135,6 +135,24 @@ The possible ``in`` messages.
}
}
+.. js:data:: "names"
+
+ Sent whenever a list of names is received for a channel::
+
+ {
+ "version": 1,
+ "type": "names",
+ "data": {
+ "channel": "",
+ "nicks": {
+ "nick": "",
+ "op_nick": "@"
+ }
+ }
+ }
+
+ This can be triggered by sending a raw command of "NAMES #channel"
+
Out messages
~~~~~~~~~~~~

0 comments on commit e1db1ba

Please sign in to comment.