From a0158ceac4cf66fe66d770ebdaab44e192910acd Mon Sep 17 00:00:00 2001 From: Psychedelic Squid Date: Sat, 10 Mar 2012 17:48:49 +0000 Subject: [PATCH] Remove category when emptied by ~rm. --- modules/quotes.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/modules/quotes.js b/modules/quotes.js index bb583db..fbb17ee 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -112,6 +112,9 @@ var quotes = function(dbot) { var index = quotes[q[1]].indexOf(q[2]); if(index != -1) { quotes[q[1]].splice(index, 1); + if(quotes[q[1]].length === 0) { + delete quotes[q[1]]; + } rmAllowed = false; dbot.say(data.channel, '\'' + q[2] + '\' removed from ' + q[1]); } else {