mirror of
https://github.com/reality/dbot.git
synced 2024-11-27 14:29:29 +01:00
spotify link in listening out
This commit is contained in:
parent
238c112986
commit
7964bb9e88
@ -1,5 +1,5 @@
|
||||
{
|
||||
"dependencies": [ "profile" ],
|
||||
"dependencies": [ "profile", "youtube", "spotify" ],
|
||||
"api_key": "blah",
|
||||
"outputPrefix": "\u000315,5last.fm\u000f"
|
||||
}
|
||||
|
@ -220,6 +220,7 @@ var lastfm = function(dbot) {
|
||||
'artist': track.artist.name
|
||||
});
|
||||
var term = track.name + ' ' + track.artist.name;
|
||||
|
||||
dbot.api.youtube.search(term, function(body) {
|
||||
if(_.isObject(body) && _.has(body, 'items') && body.items.length > 0) {
|
||||
var link = body.items[0].id.videoId
|
||||
@ -227,8 +228,15 @@ var lastfm = function(dbot) {
|
||||
output += ' - http://youtu.be/' + link;
|
||||
}
|
||||
}
|
||||
|
||||
dbot.api.spotify.spotifySearch(term, function(body, t) {
|
||||
if(body) {
|
||||
output += ' - ' + t;
|
||||
}
|
||||
|
||||
event.reply(output);
|
||||
});
|
||||
});
|
||||
} else {
|
||||
event.reply('something broke');
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user