From 879bbf63b582b6081f168c94601b1b09160d019f Mon Sep 17 00:00:00 2001 From: reality Date: Wed, 24 Jul 2013 18:02:06 +0000 Subject: [PATCH] fix youtube --- modules/youtube/youtube.js | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/youtube/youtube.js b/modules/youtube/youtube.js index 868b1d4..9c24705 100644 --- a/modules/youtube/youtube.js +++ b/modules/youtube/youtube.js @@ -48,6 +48,12 @@ var youtube = function(dbot) { 'json': true }, function(error, response, body) { if(_.isObject(body) && _.has(body, 'entry')) { + if(!_.has(v, 'yt$rating')) { + v['yt$rating'] = { + 'numLikes': 0, + 'numDislikes': 0 + }; + } var v = body.entry; event.reply(dbot.t('yt_video', { 'title': v.title['$t'],