diff options
author | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-05 14:26:20 +0200 |
---|---|---|
committer | Trygve Laugstøl <trygvis@inamo.no> | 2012-06-05 14:26:20 +0200 |
commit | f50e1111b0957df73dd67721c12b5ae28f16a630 (patch) | |
tree | 0967838b5061078a34cddfa53816daedc96924b5 /echo-bot | |
parent | 22a84cafd4145c6f1ca2f43ba65d8717cc93e3f8 (diff) | |
download | dynobot-irc-f50e1111b0957df73dd67721c12b5ae28f16a630.tar.gz dynobot-irc-f50e1111b0957df73dd67721c12b5ae28f16a630.tar.bz2 dynobot-irc-f50e1111b0957df73dd67721c12b5ae28f16a630.tar.xz dynobot-irc-f50e1111b0957df73dd67721c12b5ae28f16a630.zip |
wip
Diffstat (limited to 'echo-bot')
-rw-r--r-- | echo-bot/index.js | 18 |
1 files changed, 12 insertions, 6 deletions
diff --git a/echo-bot/index.js b/echo-bot/index.js index 8c932a8..de3ea54 100644 --- a/echo-bot/index.js +++ b/echo-bot/index.js @@ -8,15 +8,21 @@ var irc = function() { return new Proxy(IrcClient.prototype, 'irc', channel); }(); +function notice() { + irc.notice.apply(irc, arguments); + console.log.apply(null, arguments); +} + irc.on('privmsg', function(nick, channel, message) { -// console.log('privmsg: ', arguments); - irc.notice(channel, nick + ': ' + message); + notice(channel, nick + ': ' + message); }); -irc.join('#bitraf2', function() { - console.log('joined channel!'.green); +irc.on('join', function(nick, channel) { + notice(channel, 'hello ' + nick + '!'); }); -console.log("echo bot started".green); +irc.join('#bitraf2', function(nick, channel) { + notice(('on join: nick=' + nick + ', channel=' + channel).green); +}); -// process.exit(0); +console.log("echo bot started".green); |