mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 22:39:26 +01:00
Don't shit out if there's no highscore quote category
This commit is contained in:
parent
24b7c2b6b4
commit
146e7afa5b
@ -3,9 +3,14 @@ var _ = require('underscore')._;
|
|||||||
var pages = function(dbot) {
|
var pages = function(dbot) {
|
||||||
return {
|
return {
|
||||||
'/imgur/random': function(req, res) {
|
'/imgur/random': function(req, res) {
|
||||||
var hs = dbot.db.quoteArrs[dbot.config.imgur.highscore];
|
var quoteCat = dbot.db.quoteArrs[dbot.config.imgur.highscore],
|
||||||
hs = hs[hs.length-1];
|
highScore = 0;
|
||||||
res.render('imgurr', {"highscore" : hs });
|
|
||||||
|
if(quoteCat) {
|
||||||
|
highScore = _.last(quoteCat);
|
||||||
|
}
|
||||||
|
|
||||||
|
res.render('imgurr', { "highscore" : highScore });
|
||||||
},
|
},
|
||||||
|
|
||||||
'/imgur/stats': function(req, res) {
|
'/imgur/stats': function(req, res) {
|
||||||
|
Loading…
Reference in New Issue
Block a user