3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-23 20:39:25 +01:00

changed it back

This commit is contained in:
Luke Slater 2011-10-12 15:12:06 +01:00
parent 836e9e3911
commit 4222857ed3

8
run.js
View File

@ -28,8 +28,7 @@ DBot.prototype.say = function(channel, data) {
};
DBot.prototype.save = function() {
fs.writeFileSync('db.json', JSON.stringify(this.db, null, ' '));
console.log('database saved');
fs.writeFile('db.json', JSON.stringify(this.db, null, ' '));
};
DBot.prototype.reloadModules = function() {
@ -45,11 +44,7 @@ DBot.prototype.reloadModules = function() {
this.modules = [];
this.commands = {};
this.timers.clearTimers();
this.save();
this.timers.addTimer(1000 * 60 * 10, function() {
this.save();
});
var path = require.resolve('./snippets');
require.cache[path] = undefined;
@ -95,6 +90,7 @@ DBot.prototype.reloadModules = function() {
this.say(data.channel, data.user + ' is banned from using this command. Commence incineration.');
else {
this.commands[params[0]](data, params);
this.save();
}
} else {
var q = data.message.valMatch(/^~([\d\w\s]*)/, 2);