From 18c5b3ceac115200f994c440b78ceccda9a9862d Mon Sep 17 00:00:00 2001 From: Trygve Laugstøl Date: Mon, 4 Jun 2012 00:08:25 +0200 Subject: wip --- echo-bot/index.js | 22 ++++++++++++++++++++++ echo-bot/package.json | 27 +++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 echo-bot/index.js create mode 100644 echo-bot/package.json (limited to 'echo-bot') diff --git a/echo-bot/index.js b/echo-bot/index.js new file mode 100644 index 0000000..8c932a8 --- /dev/null +++ b/echo-bot/index.js @@ -0,0 +1,22 @@ +require('tinycolor'); +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); +}(); + +irc.on('privmsg', function(nick, channel, message) { +// console.log('privmsg: ', arguments); + irc.notice(channel, nick + ': ' + message); +}); + +irc.join('#bitraf2', function() { + console.log('joined channel!'.green); +}); + +console.log("echo bot started".green); + +// process.exit(0); diff --git a/echo-bot/package.json b/echo-bot/package.json new file mode 100644 index 0000000..6ca0096 --- /dev/null +++ b/echo-bot/package.json @@ -0,0 +1,27 @@ +{ + "author": { + "name": "Trygve Laugstøl", + "email": "trygvis@inamo.no", + "url": "https://github.com/trygvis" + }, + "name": "echo-bot", + "description": "Example bot that sends a NOTICE for each PRIVMSG", + "keywords": [ + "irc", + "chat" + ], + "version": "0.0.1", + "engines": { + "node": ">=0.6.18" + }, + "dependencies": { + "tinycolor": "0.0.1", + "underscore": "1.3.3" + }, + "licenses": [ + { + "type": "Apache Software License, version 2", + "url": "http://apache.org/licenses/LICENSE-2.0" + } + ] +} -- cgit v1.2.3