diff --git a/package.json b/package.json index ad7f30a..2c88884 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "discord-player-play-dl", - "version": "5.3.5", + "version": "5.3.6", "description": "Complete framework to facilitate music commands using discord.js and play-dl", "main": "dist/index.js", "types": "dist/index.d.ts", diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index 5fd12bd..1facbd6 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -697,7 +697,7 @@ class Queue { return void this.player.emit("queueEnd", this); } - const related = await play.video_info(info.related_videos[Math.random()]); + const related = await play.video_info(info.related_videos[Math.floor(Math.random() * (info.related_videos.length - 1))]); const nextTrack = new Track(this.player, { title: related.video_details.title, url: related.video_details.url,