mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
Fix ~quote syntax. It's a little messy.
This commit is contained in:
parent
6b0e2de264
commit
21ff3e002b
@ -3,7 +3,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) {
|
||||
key = q[1].trim().toLowerCase();
|
||||
if(quotes.hasOwnProperty(key)) {
|
||||
|
9
run.js
9
run.js
@ -76,9 +76,14 @@ DBot.prototype.reloadModules = function() {
|
||||
this.commands[params[0]](data, params);
|
||||
this.save();
|
||||
} else {
|
||||
var q = data.message.valMatch(/^~([\d\w\s]*)/, 2)
|
||||
var q = data.message.valMatch(/^~([\d\w\s]*)/, 2);
|
||||
if(q) {
|
||||
this.say(data.channel, this.quotes.get(q[1].trim()));
|
||||
key = q[1].trim().toLowerCase();
|
||||
if(this.db.quoteArrs.hasOwnProperty(key)) {
|
||||
this.say(data.channel, key + ': ' + this.db.quoteArrs[key].random());
|
||||
} else {
|
||||
this.say(data.channel, 'No quotes under ' + key);
|
||||
}
|
||||
}
|
||||
}
|
||||
}.bind(this));
|
||||
|
Loading…
Reference in New Issue
Block a user