require('tinycolor'); var util = require('util'); var irc = function() { var Proxy = require('../node_modules/dynobot/proxy'); var Channel = require('../node_modules/dynobot/channel'); var IrcClient = require('../irc-client.js').IrcClient; var channel = new Channel(); return new Proxy(IrcClient.prototype, 'irc', channel); }(); function notice(channel, message) { irc.notice(channel, message); console.log(('NOTICE ' + channel + ' :' + message).green); } irc.on('privmsg', function(nick, channel, message) { notice(channel, nick + ': ' + message); }); irc.on('join', function(nick, channel) { notice(channel, 'on join: hello ' + nick + '!'); }); irc.join('#dynobot', function(channel) { notice(channel, 'join(): channel=' + channel); }); console.log("echo bot started".green);