mirror of
https://github.com/reality/dbot.git
synced 2024-11-28 06:49:25 +01:00
Merge pull request #25 from psquid/master
Remove category when emptied by ~rm.
This commit is contained in:
commit
95facfa381
@ -112,6 +112,9 @@ var quotes = function(dbot) {
|
|||||||
var index = quotes[q[1]].indexOf(q[2]);
|
var index = quotes[q[1]].indexOf(q[2]);
|
||||||
if(index != -1) {
|
if(index != -1) {
|
||||||
quotes[q[1]].splice(index, 1);
|
quotes[q[1]].splice(index, 1);
|
||||||
|
if(quotes[q[1]].length === 0) {
|
||||||
|
delete quotes[q[1]];
|
||||||
|
}
|
||||||
rmAllowed = false;
|
rmAllowed = false;
|
||||||
dbot.say(data.channel, '\'' + q[2] + '\' removed from ' + q[1]);
|
dbot.say(data.channel, '\'' + q[2] + '\' removed from ' + q[1]);
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user