summaryrefslogtreecommitdiff
path: root/echo-bot
diff options
context:
space:
mode:
authorTrygve Laugstøl <trygvis@inamo.no>2012-06-04 00:08:25 +0200
committerTrygve Laugstøl <trygvis@inamo.no>2012-06-04 00:08:25 +0200
commit18c5b3ceac115200f994c440b78ceccda9a9862d (patch)
treea406719d5b1d59993df805d6668baa7dca9ba240 /echo-bot
parent1886a4eae42d0c76a2405b75170daa1ed8251227 (diff)
downloaddynobot-irc-18c5b3ceac115200f994c440b78ceccda9a9862d.tar.gz
dynobot-irc-18c5b3ceac115200f994c440b78ceccda9a9862d.tar.bz2
dynobot-irc-18c5b3ceac115200f994c440b78ceccda9a9862d.tar.xz
dynobot-irc-18c5b3ceac115200f994c440b78ceccda9a9862d.zip
wip
Diffstat (limited to 'echo-bot')
-rw-r--r--echo-bot/index.js22
-rw-r--r--echo-bot/package.json27
2 files changed, 49 insertions, 0 deletions
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"
+ }
+ ]
+}