Skip to content
This repository has been archived by the owner on Jul 17, 2020. It is now read-only.

Commit

Permalink
Add support for clearing the bot memory
Browse files Browse the repository at this point in the history
  • Loading branch information
BobVul committed Nov 7, 2015
1 parent 072d263 commit e0fb095
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions source/bot.js
Original file line number Diff line number Diff line change
Expand Up @@ -315,6 +315,14 @@ bot.memory = {
clearTimeout( this.saveIntervalId );
setTimeout( this.saveLoop.bind(this), this.saveInterval );
}

clear : function () {
Object.iterate( localStorage, function ( key, val ) {
if ( key.startsWith('bot_') ) {
localStorage.removeItem(key);
}
});
this.data = {};
};

bot.memory.loadAll();
Expand Down

0 comments on commit e0fb095

Please sign in to comment.