From 4222857ed37a24799950bff56a77d254a158bb7f Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 12 Oct 2011 15:12:06 +0100 Subject: [PATCH] changed it back --- run.js | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/run.js b/run.js index bcb7e69..bbe8a02 100644 --- a/run.js +++ b/run.js @@ -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);