Closed Katazui closed 12 years ago
You'd have to run a function every time the "new song" event is fired. Check the data returned from the event, grab the userid of the current DJ, and compare to the user you want to grab songs from. If it's the same user, add the song to your playlist.
var Bot = require('ttapi');
var bot = new Bot('auth+live+xxx', 'xxx', 'xxx');
bot.on('newsong', function (data) {
bot.snag();
bot.playlistAdd(data.room.metadata.current_song._id);
bot.becomeFan(data.room.metadata.current_dj);
});
Something like this should work. (I didn't test the code)
Yay, it works. Thanks.
How can the bot snag every song a person plays and adds it to their playlist? And become that persons fan when they play at the same time?