From c0c235f04597388a912c3518cf80790f52306547 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 9 Jul 2012 19:45:45 +0100 Subject: [PATCH] dont bother with a quote if the key begins with _. So I can perform ~_~ unmolested in channel. --- modules/kick.js | 2 -- modules/quotes.js | 14 ++++++++------ snippets.js | 4 ++-- 3 files changed, 10 insertions(+), 10 deletions(-) diff --git a/modules/kick.js b/modules/kick.js index a99041b..540f9b7 100644 --- a/modules/kick.js +++ b/modules/kick.js @@ -1,6 +1,4 @@ var kick = function(dbot) { - var dbot = dbot; - var commands = { // Give the number of times a given user has been kicked and has kicked // other people. diff --git a/modules/quotes.js b/modules/quotes.js index 5a17592..3d1e9d1 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -46,12 +46,14 @@ var quotes = function(dbot) { altKey = key.replace(/ /g, '_'); } - if(quotes.hasOwnProperty(key)) { - event.reply(key + ': ' + interpolatedQuote(key)); - } else if(quotes.hasOwnProperty(altKey)) { - event.reply(altKey + ': ' + interpolatedQuote(altKey)); - } else { - event.reply(dbot.t('category_not_found', {'category': key})); + if(key.charAt(0) !== '_') { // lol + if(quotes.hasOwnProperty(key)) { + event.reply(key + ': ' + interpolatedQuote(key)); + } else if(quotes.hasOwnProperty(altKey)) { + event.reply(altKey + ': ' + interpolatedQuote(altKey)); + } else { + event.reply(dbot.t('category_not_found', {'category': key})); + } } }, diff --git a/snippets.js b/snippets.js index a02ffda..7b299c9 100644 --- a/snippets.js +++ b/snippets.js @@ -164,13 +164,13 @@ Object.prototype.isArray = function(obj) { return Object.prototype.toString.call(obj) === '[object Array]'; }; -/*Object.prototype.withAll = function(fun) { +Object.prototype.withAll = function(fun) { for(key in this) { if(this.hasOwnProperty(key)){ fun(key, this[key]); } } -};*/ +}; Object.prototype.length = function() { var l = 0;