diff --git a/modules/quotes/commands.js b/modules/quotes/commands.js index 89fc33c..207a30d 100644 --- a/modules/quotes/commands.js +++ b/modules/quotes/commands.js @@ -187,8 +187,12 @@ var commands = function(dbot) { }, '~rq': function(event) { - var category = _.keys(quotes)[_.random(0, _.size(quotes) -1)]; - event.reply(category + ': ' + this.internalAPI.interpolatedQuote(event.server, event.channel.name, category)); + if(_.keys(quotes).length > 0) { + var category = _.keys(quotes)[_.random(0, _.size(quotes) -1)]; + event.reply(category + ': ' + this.internalAPI.interpolatedQuote(event.server, event.channel.name, category)); + } else { + event.reply(dbot.t('no_results')); + } }, '~link': function(event) {