From 487234078441e1a2439bc1fd6b36021270bc6c12 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 12 Dec 2011 14:06:05 +0000 Subject: [PATCH 1/2] Allow - in category names --- modules/quotes.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/quotes.js b/modules/quotes.js index 640d078..eab5454 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -100,7 +100,7 @@ var quotes = function(dbot) { }, '~qadd': function(data, params) { - var q = data.message.valMatch(/^~qadd ([\d\w\s]*)=(.+)$/, 3); + var q = data.message.valMatch(/^~qadd ([\d\w\s-]*)=(.+)$/, 3); if(q) { key = q[1].toLowerCase(); if(!Object.isArray(quotes[key])) { From d46294c576f9a155717aaf32a4d7305aa075d489 Mon Sep 17 00:00:00 2001 From: Luke Slater Date: Mon, 12 Dec 2011 14:08:56 +0000 Subject: [PATCH 2/2] accept - in categories everywhere --- modules/quotes.js | 8 ++++---- run.js | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/quotes.js b/modules/quotes.js index eab5454..b5a8cef 100644 --- a/modules/quotes.js +++ b/modules/quotes.js @@ -5,7 +5,7 @@ var quotes = function(dbot) { var commands = { '~q': function(data, params) { - var q = data.message.valMatch(/^~q ([\d\w\s]*)/, 2); + var q = data.message.valMatch(/^~q ([\d\w\s-]*)/, 2); if(q) { q[1] = q[1].trim(); key = q[1].toLowerCase(); @@ -45,7 +45,7 @@ var quotes = function(dbot) { '~rmlast': function(data, params) { if(rmAllowed == true || data.user == dbot.admin) { - var q = data.message.valMatch(/^~rmlast ([\d\w\s]*)/, 2); + var q = data.message.valMatch(/^~rmlast ([\d\w\s-]*)/, 2); if(q) { q[1] = q[1].trim() key = q[1].toLowerCase(); @@ -80,7 +80,7 @@ var quotes = function(dbot) { }, '~qcount': function(data, params) { - var q = data.message.valMatch(/^~qcount ([\d\w\s]*)/, 2); + var q = data.message.valMatch(/^~qcount ([\d\w\s-]*)/, 2); if(q) { q[1] = q[1].trim(); key = q[1].toLowerCase(); @@ -125,7 +125,7 @@ var quotes = function(dbot) { }, '~qset': function(data, params) { - var q = data.message.valMatch(/^~qset ([\d\w\s]*)=(.+)$/, 3); + var q = data.message.valMatch(/^~qset ([\d\w\s-]*)=(.+)$/, 3); if(q) { q[1] = q[1].trim(); key = q[1].toLowerCase(); diff --git a/run.js b/run.js index a840b3e..ae6a16a 100644 --- a/run.js +++ b/run.js @@ -104,7 +104,7 @@ DBot.prototype.reloadModules = function() { this.save(); } } else { - var q = data.message.valMatch(/^~([\d\w\s]*)/, 2); + var q = data.message.valMatch(/^~([\d\w\s-]*)/, 2); if(q) { if(this.db.bans['*'].include(data.user)) { this.say(data.channel, data.user +