diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index 9f948c3..e9a8d84 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -203,6 +203,7 @@ class Queue { */ addTrack(track: Track) { this.#watchDestroyed(); + if (!(track instanceof Track)) throw new Error("invalid track"); this.tracks.push(track); this.player.emit("trackAdd", this, track); } @@ -213,6 +214,7 @@ class Queue { */ addTracks(tracks: Track[]) { this.#watchDestroyed(); + if (!tracks.every((y) => y instanceof Track)) throw new Error("invalid track"); this.tracks.push(...tracks); this.player.emit("tracksAdd", this, tracks); }