diff options
Diffstat (limited to 'echo-bot/index.js')
-rw-r--r-- | echo-bot/index.js | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/echo-bot/index.js b/echo-bot/index.js index de3ea54..234e450 100644 --- a/echo-bot/index.js +++ b/echo-bot/index.js @@ -1,4 +1,5 @@ require('tinycolor'); +var util = require('util'); var irc = function() { var Proxy = require('../node_modules/dynobot/proxy'); var Channel = require('../node_modules/dynobot/channel'); @@ -8,9 +9,9 @@ var irc = function() { return new Proxy(IrcClient.prototype, 'irc', channel); }(); -function notice() { - irc.notice.apply(irc, arguments); - console.log.apply(null, arguments); +function notice(channel, message) { + irc.notice(channel, message); + console.log(('NOTICE ' + channel + ' :' + message).green); } irc.on('privmsg', function(nick, channel, message) { @@ -18,11 +19,11 @@ irc.on('privmsg', function(nick, channel, message) { }); irc.on('join', function(nick, channel) { - notice(channel, 'hello ' + nick + '!'); + notice(channel, 'on join: hello ' + nick + '!'); }); -irc.join('#bitraf2', function(nick, channel) { - notice(('on join: nick=' + nick + ', channel=' + channel).green); +irc.join('#bitraf2', function(channel) { + notice(channel, 'join(): channel=' + channel); }); console.log("echo bot started".green); |