Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adds 'names' listener to node bot with docs update

  • Loading branch information...
commit bd8f4859b47a51c967527d547636d2213ef74f4e 1 parent 6b73aa7
@aaronpk aaronpk authored
Showing with 32 additions and 0 deletions.
  1. +14 −0 bot.js
  2. +18 −0 docs/services_devel.rst
View
14 bot.js
@@ -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);
});
View
18 docs/services_devel.rst
@@ -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
~~~~~~~~~~~~
Please sign in to comment.
Something went wrong with that request. Please try again.