forked from GitHub/dbot
'~CATEGORY' now dispatches a '~q CATEGORY' command.
This commit is contained in:
parent
27baefb6ce
commit
a4313ee665
@ -66,8 +66,14 @@ var command = function(dbot) {
|
|||||||
} else {
|
} else {
|
||||||
q[1] = q[1].trim();
|
q[1] = q[1].trim();
|
||||||
key = dbot.cleanNick(q[1])
|
key = dbot.cleanNick(q[1])
|
||||||
if(dbot.db.quoteArrs.hasOwnProperty(key)) {
|
if(dbot.db.quoteArrs.hasOwnProperty(key) && dbot.moduleNames.include('quotes')) {
|
||||||
dbot.say(data.channel, q[1] + ': ' + dbot.interpolatedQuote(key));
|
var params = ['~q'];
|
||||||
|
key.split(' ').each((function(word) {
|
||||||
|
this.push(word);
|
||||||
|
}).bind(params));
|
||||||
|
data.message = params.join(' ');
|
||||||
|
dbot.commands[params[0]](data, params);
|
||||||
|
dbot.save();
|
||||||
} else {
|
} else {
|
||||||
// See if it's similar to anything
|
// See if it's similar to anything
|
||||||
var winnerDistance = Infinity;
|
var winnerDistance = Infinity;
|
||||||
|
Loading…
Reference in New Issue
Block a user