irc-channels

Add channel support to irc-connect

irc-channels

Channel features for irc-connect.

var channels = require('irc-channels');
var irc = require("irc-connect");
 
irc.connect('irc.freenode.net')
    .use(irc.pong, channels)
    .on('welcome', function (msg) {
        console.log(msg);
 
        this.join('#node.js', function(channel){
 
            channel.on('data', function (event) {
                console.log(JSON.stringify(event));
            });
 
            console.log(channel.topic);
            channel.msg('I got https://npmjs.org/package/irc-channels working!');
        })
    })
;

It is an EventEmitter with some extras.

A proxy to irc-connect's send() function; It sends the text followed by a \n.

Gets the name of the channel.

Sends a PRIVMSG to the channel.

Leave the channel.

Gets current topic of the channel. Returns an object.

console.log(JSON.stringify(channel.topic, null, 2));
//{ 
//  "message": "Hello irc-connect ppl", 
//  "by": "wwicks!~wwicks@0.0.0.0", 
//  "at": "1379547726" 
//} 

Gets and Array of the current channel members. The list is updated when QUIT | JOIN | PART happen.

The channel will emit the following channel specific events:

Emitted anytime the names list has been parsed for this channel.

MIT