From d17ee733930f1680f6e682d841b2d69c540ff831 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Wed, 24 Aug 2011 16:15:56 +0100 Subject: [PATCH] lower-case all quote keys --- modules/quotes.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/modules/quotes.js b/modules/quotes.js index 7424506..696175f 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -3,6 +3,7 @@ var quotes = function(dbot) { return { get: function(key) { + key = key.toLowerCase(); if(quotes.hasOwnProperty(key)) { return key + ': ' + quotes[key].random(); } else { @@ -11,6 +12,7 @@ var quotes = function(dbot) { }, count: function(key) { + key = key.toLowerCase(); if(quotes.hasOwnProperty(key)) { return key + ' has ' + quotes[key].length + ' quotes.'; } else { @@ -19,6 +21,7 @@ var quotes = function(dbot) { }, add: function(key) { + key[1] = key[1].toLowerCase(); if(!Object.isArray(quotes[key[1]])) { quotes[key[1]] = []; } @@ -27,6 +30,7 @@ var quotes = function(dbot) { }, set: function(key) { + key[1] = key[1].toLowerCase(); if(!quotes.hasOwnProperty(key[1]) || (quotes.hasOwnProperty(key[1]) && quotes[key[1]].length == 1)) { quotes[key[1]] = [key[2]]; return 'Quote saved as ' + key[1];