Closed samuri51 closed 11 years ago
heres an example of what i'm currently trying
if (upVotes >= howManyVotesToSnag)
{
bot.playlistAll(function (playlist)
{
bot.playlistAdd(songId, playlist.list.length, function (call)
{
if (call.success === true)
{
bot.snag();
}
});
});
}
Something like this could work :
var snagIfNotInPlaylist = function() {
bot.playlistAll(function(data) {
var found = false;
for (var i = 0; i < data.list.length; i++) {
if (data.list[i]._id == bot.currentSongId) {
found = true;
break;
}
}
if (!found) {
bot.snag();
}
});
};
It looks in your playlist. If it find the current song, it'll not snag it.
You may also want to check song name and artist. As there are some duplicates out there.
thanks, just tested it and it works :+1:
does anyone know how to have bot.snag() gives the heart animation only when the song is not already in the bot's playlist? i notice itll give the snag animation but no new songs have been added, yes i know it doesn't add songs.