3
0
mirror of https://github.com/reality/dbot.git synced 2024-12-25 04:02:39 +01:00

delete category when rmlast makes empty quote category

This commit is contained in:
Luke Slater 2012-02-27 15:11:43 +00:00
parent 81d34ce304
commit 1a6146b348

View File

@ -52,6 +52,9 @@ var quotes = function(dbot) {
if(quotes.hasOwnProperty(q[1])) { if(quotes.hasOwnProperty(q[1])) {
if(!dbot.db.locks.include(q[1]) || data.user == dbot.admin) { if(!dbot.db.locks.include(q[1]) || data.user == dbot.admin) {
var quote = quotes[key].pop(); var quote = quotes[key].pop();
if(quotes[key] === undefined) {
delete quotes[key];
}
rmAllowed = false; rmAllowed = false;
dbot.say(data.channel, '\'' + quote + '\' removed from ' + q[1]); dbot.say(data.channel, '\'' + quote + '\' removed from ' + q[1]);
} else { } else {