diff --git a/package.json b/package.json index 29e7d6c..96503e7 100644 --- a/package.json +++ b/package.json @@ -51,7 +51,7 @@ "homepage": "https://discord-player.js.org", "dependencies": { "@discordjs/voice": "^0.5.0", - "discord-ytdl-core": "^5.0.3", + "discord-ytdl-core": "^5.0.4", "libsodium-wrappers": "^0.7.9", "soundcloud-scraper": "^5.0.0", "spotify-url-info": "^2.2.3", diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index db07fc9..494db44 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -220,6 +220,7 @@ class Queue { const newFilters = AudioFilters.create(_filters); return await this.play(this.current, { + immediate: true, filtersUpdate: true, seek: this.streamTime, encoderArgs: ["-af", newFilters] @@ -267,7 +268,7 @@ class Queue { fmt: "s16le", encoderArgs: options.encoderArgs ?? [], seek: options.seek - }).on("error", (err) => this.player.emit("error", this, err)); + }).on("error", (err) => (err.message.toLowerCase().includes("premature close") ? null : this.player.emit("error", this, err))); } else { stream = ytdl .arbitraryStream( @@ -279,7 +280,7 @@ class Queue { seek: options.seek } ) - .on("error", (err) => this.player.emit("error", this, err)); + .on("error", (err) => (err.message.toLowerCase().includes("premature close") ? null : this.player.emit("error", this, err))); } const resource: AudioResource = this.connection.createStream(stream, { diff --git a/src/utils/AudioFilters.ts b/src/utils/AudioFilters.ts index 2da0700..ccb12b3 100644 --- a/src/utils/AudioFilters.ts +++ b/src/utils/AudioFilters.ts @@ -78,7 +78,7 @@ const FilterList = { }, toString() { - return this.names.map(m => (this as any)[m]).join(","); + return this.names.map((m) => (this as any)[m]).join(","); }, create(filter?: FiltersName[]): string {