3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00

Merge git://github.com/reality/depressionbot

This commit is contained in:
Psychedelic Squid 2012-03-10 18:01:21 +00:00
commit 9fa5644a6b
3 changed files with 14 additions and 2 deletions

View File

@ -1,4 +1,6 @@
var fs = require('fs');
var sys = require('sys')
var exec = require('child_process').exec;
var adminCommands = function(dbot) {
var dbot = dbot;
@ -17,6 +19,16 @@ var adminCommands = function(dbot) {
dbot.instance.part(params[1]);
},
// Do a git pull and reload
'greload': function(data, params) {
var child;
child = exec("git pull", function (error, stdout, stderr) {
console.log(stderr);
commands.reload(data, params);
}.bind(this));
},
'reload': function(data, params) {
dbot.db = JSON.parse(fs.readFileSync('db.json', 'utf-8'));
dbot.reloadModules();

View File

@ -12,7 +12,7 @@ var quotes = function(dbot) {
if(quotes.hasOwnProperty(key)) {
dbot.say(data.channel, q[1] + ': ' + dbot.interpolatedQuote(key));
} else {
dbot.say(data.channel, 'Nobody loves ' + q[1]);
dbot.say(data.channel, 'No one loves ' + q[1]);
}
}
},

View File

@ -7,7 +7,7 @@ html(lang='en')
body
div#page
div#title
a(href='/') Depressionbot web interface
a(href='/') #{name} web interface
div#main
!{body}
script(type="text/javascript", src="/script.js")