fix repeate mode

This commit is contained in:
KGT1 2020-10-06 00:26:46 +02:00
parent 574bb45991
commit 76ef7d1e3e

View File

@ -53,6 +53,9 @@ function startPlaying (voiceconnection = discordclientmanager.getDiscordClient()
} }
getAudioDispatcher().on("finish", () => { getAudioDispatcher().on("finish", () => {
if(isRepeat){
startPlaying(voiceconnection,itemIDPlaylist,currentPlayingPlaylistIndex,0)
}else{
if (currentPlayingPlaylist.length < playlistIndex) { if (currentPlayingPlaylist.length < playlistIndex) {
if (disconnectOnFinish) { if (disconnectOnFinish) {
stop(voiceconnection, currentPlayingPlaylist[playlistIndex - 1]); stop(voiceconnection, currentPlayingPlaylist[playlistIndex - 1]);
@ -61,7 +64,7 @@ function startPlaying (voiceconnection = discordclientmanager.getDiscordClient()
} }
} else { } else {
startPlaying(voiceconnection, itemIDPlaylist, currentPlayingPlaylistIndex + 1, 0); startPlaying(voiceconnection, itemIDPlaylist, currentPlayingPlaylistIndex + 1, 0);
} }}
}); });
} }
playasync().catch((rsn) => { playasync().catch((rsn) => {