mirror of
https://github.com/reality/dbot.git
synced 2024-12-25 04:02:39 +01:00
params argument was being passed as the quoteTree, breaking quotes FOREVER
This commit is contained in:
parent
a6024c9b7d
commit
eedbe1f287
@ -4,7 +4,7 @@ var quotes = function(dbot) {
|
||||
var rmAllowed = true;
|
||||
|
||||
// Retrieve a random quote from a given category, interpolating any quote references (~~QUOTE CATEGORY~~) within it
|
||||
var interpolatedQuote = function(key, quoteTree, params) {
|
||||
var interpolatedQuote = function(key, quoteTree) {
|
||||
if(quoteTree !== undefined && quoteTree.indexOf(key) != -1) {
|
||||
return '';
|
||||
} else if(quoteTree === undefined) {
|
||||
@ -51,7 +51,7 @@ var quotes = function(dbot) {
|
||||
q[1] = q[1].trim();
|
||||
key = q[1].toLowerCase();
|
||||
if(quotes.hasOwnProperty(key)) {
|
||||
dbot.say(data.channel, q[1] + ': ' + interpolatedQuote(key, params));
|
||||
dbot.say(data.channel, q[1] + ': ' + interpolatedQuote(key));
|
||||
} else {
|
||||
dbot.say(data.channel, 'Nobody loves ' + q[1]);
|
||||
}
|
||||
@ -232,11 +232,11 @@ var quotes = function(dbot) {
|
||||
|
||||
'~rq': function(data, params) {
|
||||
var rQuote = Object.keys(quotes).random();
|
||||
dbot.say(data.channel, rQuote + ': ' + interpolatedQuote(rQuote, params));
|
||||
dbot.say(data.channel, rQuote + ': ' + interpolatedQuote(rQuote));
|
||||
},
|
||||
|
||||
'~d': function(data, params) {
|
||||
dbot.say(data.channel, data.user + ': ' + interpolatedQuote(dbot.name, params));
|
||||
dbot.say(data.channel, data.user + ': ' + interpolatedQuote(dbot.name));
|
||||
},
|
||||
|
||||
'~link': function(data, params) {
|
||||
|
Loading…
Reference in New Issue
Block a user