summaryrefslogtreecommitdiff
path: root/dynobot-irc.js
diff options
context:
space:
mode:
Diffstat (limited to 'dynobot-irc.js')
-rw-r--r--dynobot-irc.js20
1 files changed, 13 insertions, 7 deletions
diff --git a/dynobot-irc.js b/dynobot-irc.js
index 20f6f79..24dd2ee 100644
--- a/dynobot-irc.js
+++ b/dynobot-irc.js
@@ -74,7 +74,12 @@ var nick = 'dynobot';
var realName = 'bots\'r\'us';
var ident = 'ident';
-if(false) {
+function info(a, b, c) {
+ console.log.apply(null, arguments);
+}
+
+var reallyConnect = true;
+if(reallyConnect) {
irc = new IrcClient(nick, realName, ident, 'irc.freenode.net', 6667);
}
else {
@@ -102,11 +107,12 @@ function Plugin(name, script) {
}
var plugins = [
- new Plugin('echo', './echo-bot/index.js')
+// new Plugin('echo', './echo-bot/index.js')
+ new Plugin('atom', './atom-bot/index.js')
];
_.each(plugins, function(plugin) {
- console.log('Starting ' + plugin.name);
+ info('Starting ' + plugin.name);
// TODO: Resolve plugin.script
// TODO: set cwd option to the plugin's directory.
var args = [];
@@ -117,7 +123,7 @@ _.each(plugins, function(plugin) {
var channel = new Channel(child);
ircService.handle(channel);
child.on('exit', function() {
- console.log(plugin.name + ' exited..');
+ info(plugin.name + ' exited..');
ircService.release(channel);
channel.close();
});
@@ -181,7 +187,7 @@ function setupRepl() {
stdinPipe.send(':' + from + ' NOTICE ' + channel + ' :' + parts.join(' '));
}
else {
- console.log('You have to /j a channel first');
+ info('You have to /j a channel first');
}
break;
default:
@@ -196,10 +202,10 @@ function setupRepl() {
}
irc.join('#bitraf2', function(name) {
- console.log('joined ' + name + ' from dynobot.');
+ info('joined ' + name + ' from dynobot.');
});
-console.log('colors: ' + 'from bot'.red + ', ' + 'to bot'.blue);
+info('colors: ' + 'from bot'.red + ', ' + 'to bot'.blue);
irc.connect();
setupRepl(i);