set last link in channel when ~yt command is used

This commit is contained in:
Scritches 2018-04-10 13:30:20 -04:00
parent bb28cebde1
commit 597171c37d

View File

@ -93,6 +93,7 @@ var youtube = function(dbot) {
}, function(error, response, body) { }, function(error, response, body) {
if(_.isObject(body) && _.has(body, 'items') && body.items.length > 0) { if(_.isObject(body) && _.has(body, 'items') && body.items.length > 0) {
event.reply(this.internalAPI.formatLink(body.items[0])); event.reply(this.internalAPI.formatLink(body.items[0]));
dbot.modules.link.links[event.channel.name] = 'https://youtu.be/' + body.items[0].id;
} }
}.bind(this)); }.bind(this));
} else { } else {