diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-14 18:42:09 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-14 18:42:09 +0200 |
commit | e971ae61c99c8a602a1d60c95e9f8f908d4cf053 (patch) | |
tree | cda91535e2d7d0b7183709939910c1b05534afd5 /echo-bot | |
parent | f50e1111b0957df73dd67721c12b5ae28f16a630 (diff) | |
download | dynobot-irc-e971ae61c99c8a602a1d60c95e9f8f908d4cf053.tar.gz dynobot-irc-e971ae61c99c8a602a1d60c95e9f8f908d4cf053.tar.bz2 dynobot-irc-e971ae61c99c8a602a1d60c95e9f8f908d4cf053.tar.xz dynobot-irc-e971ae61c99c8a602a1d60c95e9f8f908d4cf053.zip |
wip
Diffstat (limited to 'echo-bot')
-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); |