3
0
mirror of https://github.com/reality/dbot.git synced 2024-11-27 22:39:26 +01:00

dupe protection in realityonce

This commit is contained in:
Luke Slater 2012-08-08 16:11:22 +01:00
parent c3dbef3174
commit 40d239802d

View File

@ -247,10 +247,14 @@ var quotes = function(dbot) {
if(!dbot.db.quoteArrs.hasOwnProperty('realityonce')) { if(!dbot.db.quoteArrs.hasOwnProperty('realityonce')) {
dbot.db.quoteArrs['realityonce'] = []; dbot.db.quoteArrs['realityonce'] = [];
} }
dbot.db.quoteArrs['realityonce'].push('reality ' + once[1] + '.'); if(dbot.db.quoteArrs['realityonce'].include('reality ' + once[1] + '.')) {
addStack.push('realityonce'); event.reply(event.user + ': reality has already done that once.');
rmAllowed = true; } else {
event.reply('\'reality ' + once[1] + '.\' saved.'); dbot.db.quoteArrs['realityonce'].push('reality ' + once[1] + '.');
addStack.push('realityonce');
rmAllowed = true;
event.reply('\'reality ' + once[1] + '.\' saved.');
}
} }
} }
} }