From 6d9f3b644c78a54001bc9aee854c1f8ce33d3382 Mon Sep 17 00:00:00 2001 From: reality Date: Mon, 20 May 2013 19:51:09 +0000 Subject: [PATCH] fix ~rmdeny and add web route /quoteremovals [#455] --- modules/quotes/commands.js | 2 +- modules/quotes/pages.js | 7 +++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/modules/quotes/commands.js b/modules/quotes/commands.js index e8205c7..1ce726a 100644 --- a/modules/quotes/commands.js +++ b/modules/quotes/commands.js @@ -87,7 +87,7 @@ var commands = function(dbot) { _.each(rmCache, function(quote, index) { this.api.addQuote(quote.key, quote.quote, event.user, function(newCount) { }); - }); + }.bind(this)); rmCache.length = 0; event.reply(dbot.t('quote_cache_reinstated', diff --git a/modules/quotes/pages.js b/modules/quotes/pages.js index 0f0c977..abdd4c3 100644 --- a/modules/quotes/pages.js +++ b/modules/quotes/pages.js @@ -30,6 +30,13 @@ var pages = function(dbot) { }); }); }, + + '/quoteremovals': function(req, res) { + res.render('quotes', { + 'name': dbot.config.name, + 'quotes': _.pluck(this.rmCache, 'quote') + }); + } } };