diff --git a/run.js b/run.js index 29167ed..4f697dc 100644 --- a/run.js +++ b/run.js @@ -67,7 +67,9 @@ var DBot = function(timers) { }; // Retrieve a random quote from a given category, interpolating any quote references (~~QUOTE CATEGORY~~) within it -DBot.prototype.interpolatedQuote = function(key) { +DBot.prototype.interpolatedQuote = function(key, quoteTree) { + if( quoteTree !== undefined && quoteTree.indexOf( key ) != -1 ) return ''; + else if( quoteTree === undefined ) quoteTree = []; var quoteString = this.db.quoteArrs[key].random(); var quoteRefs; while( (quoteRefs = quoteString.match(/~~([\d\w\s-]*)~~/)) ) { @@ -75,7 +77,10 @@ DBot.prototype.interpolatedQuote = function(key) { for(var i=0;i