forked from martynsmith/node-irc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbot.js
28 lines (23 loc) · 731 Bytes
/
bot.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
var util = require('util');
var pm = require('./passwordmanager');
var mh = require('./modulehandler');
var irc = require('./lib/irc');
// Setup bot instance
var nick = 'Preben';
var bot = new irc.Client('se.quakenet.org', nick, {
debug: false,
channels: pm.channels
//channels: ["#4j"]
});
// Start pluginhandler
var modulehandler = new mh.ModuleHandler( bot );
// Auth in Q
bot.on('motd', function(motd) {
bot.say( '[email protected]', util.format('AUTH %s %s', pm.qnet.quser, pm.qnet.qpass) );
bot.send( 'MODE', nick, '+x');
});
// Catch exceptions
process.on('uncaughtException', function ( err ) {
util.log( util.format('uncaughtException bobbled up --> %s', err) );
util.log( err.stack );
});