samuri51 / chillybot

a turntable bot created by a moderator of straight_chillin11
12 stars 12 forks source link

Adding Songs to the Bottom of the Playlist #44

Closed ghost closed 11 years ago

ghost commented 11 years ago

How can I make Chillster add songs to the bottom of his playlist.

The code that I am using for him to snag songs is:

bot.on('newsong', function (data) {
   bot.snag();
   bot.playlistAdd(data.room.metadata.current_song._id);
   bot.becomeFan(data.room.metadata.current_dj);
});
samuri51 commented 11 years ago

if chillster a chillybot then shouldnt it already be able to add songs? anyway to modify your code... all you need is a second parameter. -1 means the end of the bots playlist, i only know this because a developer at turntable told me thats what it was :p. there are other ways but this is the preferred way

bot.on('newsong', function (data) {
   bot.snag();
   bot.playlistAdd(data.room.metadata.current_song._id, -1);
   bot.becomeFan(data.room.metadata.current_dj);
});
ghost commented 11 years ago

ok, thanks :)