function playMusic(id, message, backQueueUsed) {
voiceChannel = message.member.voiceChannel || voiceChannel;
if (voiceChannel != null) {
voiceChannel.join()
.then(function(connection) {
stream = ytdl("https://www.youtube.com/watch?v=" + id, {
filter: 'audioonly'
});
skipReq = 0;
skippers = [];
dispatcher = connection.playStream(stream);
dispatcher.on('end', function() {
skipReq = 0;
skippers = [];
if (backQueueUsed) {
currentBackQueue++;
} else {
queue.shift();
queueNames.shift();
}
if (queue.length === 0) {
queue = [];
queueNames = [];
if (backQueue.length === currentBackQueue) {
currentBackQueue = 0;
}
youtube.search_video(backQueue[currentBackQueue] + " succ", function(id) {
playMusic(id, message, true);
});
} else {
playMusic(queue[0], message, false);
}
});
});
} else {
message.reply("Please be in a voiceChannel or have the bot already in a voiceChannel");
}
}
这是我认为是问题的代码片段。请帮帮我。