Skip to content
Browse files

A bit of a formatting cleanup and adding channelListReturned.

  • Loading branch information...
1 parent d7e9794 commit 38a48402cb91fb2081089b053335bc8bf0106dda @simonwex simonwex committed Aug 14, 2012
Showing with 16 additions and 12 deletions.
  1. +16 −12 app/irc/bot.js
View
28 app/irc/bot.js
@@ -14,7 +14,6 @@ irc = require('irc'),
util = require('util'),
Listeners = require('./bot-listeners'),
Worker = require('./bot-worker'),
-uuid = require('node-uuid'),
events = require('events');
require('../../lib/extensions/number');
@@ -50,23 +49,28 @@ function Bot(){
// Contextualize this for annonymous callbacks
var self = this;
+
+ this.client.setMaxListeners(12);
- this.client.addListener('error', this.listeners.error);
+ this.client.addListener('error', this.listeners.error);
+
+ this.client.addListener('close', this.listeners.connectionClosed);
+ this.client.once('registered', this.listeners.botRegistered);
+
+ this.client.addListener('join', this.listeners.userJoinedMotownChannel);
- this.client.addListener('close', this.listeners.connectionClosed);
- this.client.once('registered', this.listeners.botRegistered);
+ this.client.addListener('part', this.listeners.userLeft); // channel, who, reason
+ this.client.addListener('kick', this.listeners.userLeft); // channel, who, by, reason
+ this.client.addListener('kill', this.listeners.userDisconnected); // who, reason, channels
+ this.client.addListener('quit', this.listeners.userDisconnected); // who, reason, channels
- this.client.addListener('join', this.listeners.userJoinedMotownChannel);
+ this.client.addListener('nick', this.listeners.userNickChanged);
- this.client.addListener('part', this.listeners.userLeft); // channel, who, reason
- this.client.addListener('kick', this.listeners.userLeft); // channel, who, by, reason
- this.client.addListener('kill', this.listeners.userDisconnected); // who, reason, channels
- this.client.addListener('quit', this.listeners.userDisconnected); // who, reason, channels
+ this.client.addListener('channellist', this.listeners.channelListReturned);
- this.client.addListener('nick', this.listeners.userNickChanged);
- this.client.addListener('raw', function(p){logger.silly(p)});
+ this.client.addListener('raw', function(p){logger.silly(p)});
- this.on('operational', function(){this.state = 'operational'});
+ this.on('operational', function(){this.state = 'operational'});
this.state = "ready";
}

0 comments on commit 38a4840

Please sign in to comment.
Something went wrong with that request. Please try again.