mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
changed it back
This commit is contained in:
parent
836e9e3911
commit
4222857ed3
8
run.js
8
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);
|
||||
|
Loading…
Reference in New Issue
Block a user