limit length of karma thing

This commit is contained in:
reality 2015-02-19 17:12:25 +00:00
parent cafe173911
commit cdc8cb0d74

View File

@ -98,7 +98,7 @@ var karma = function(dbot) {
this.listener = function(event) { this.listener = function(event) {
var match = event.message.match(/^(.+)(\+\+|\-\-)$/); var match = event.message.match(/^(.+)(\+\+|\-\-)$/);
if(match) { if(match && match[1].length < 25) {
match[1] = match[1].replace(/(\+|\-)/g,'').replace(/:/g,'').trim(); match[1] = match[1].replace(/(\+|\-)/g,'').replace(/:/g,'').trim();
if(_.has(this.lastKarma, event.rUser.id) && this.lastKarma[event.rUser.id] + 5000 > Date.now()) { if(_.has(this.lastKarma, event.rUser.id) && this.lastKarma[event.rUser.id] + 5000 > Date.now()) {
return event.reply('Try again in a few seconds : - )'); return event.reply('Try again in a few seconds : - )');