forked from martynsmith/node-irc
-
Notifications
You must be signed in to change notification settings - Fork 1
/
test.js
executable file
·29 lines (23 loc) · 696 Bytes
/
test.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
#!/usr/bin/env node
var irc = require('./lib/irc.js');
var util = require('util');
var color = require('ansi-color').set;
var c = new irc.Client(
'irc.dollyfish.net.nz',
'nodebot',
{
channels: ['#test'],
//debug: true
}
);
c.addListener('raw', function(message) { console.log('raw: ', message) });
c.addListener('error', function(message) { console.log(color('error: ', 'red'), message) });
var repl = require('repl').start('> ');
repl.context.repl = repl;
repl.context.util = util;
repl.context.irc = irc;
repl.context.c = c;
repl.inputStream.addListener('close', function() {
console.log("\nClosing session");
c.disconnect('Closing session');
});