mirror of
https://github.com/reality/dbot.git
synced 2024-12-28 05:32:50 +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) {
|
||||
return {
|
||||
'/imgur/random': function(req, res) {
|
||||
var hs = dbot.db.quoteArrs[dbot.config.imgur.highscore];
|
||||
hs = hs[hs.length-1];
|
||||
res.render('imgurr', {"highscore" : hs });
|
||||
var quoteCat = dbot.db.quoteArrs[dbot.config.imgur.highscore],
|
||||
highScore = 0;
|
||||
|
||||
if(quoteCat) {
|
||||
highScore = _.last(quoteCat);
|
||||
}
|
||||
|
||||
res.render('imgurr', { "highscore" : highScore });
|
||||
},
|
||||
|
||||
'/imgur/stats': function(req, res) {
|
||||
|
Loading…
Reference in New Issue
Block a user