diff --git a/src/Player.ts b/src/Player.ts index f67826e..a635613 100644 --- a/src/Player.ts +++ b/src/Player.ts @@ -117,7 +117,7 @@ class Player extends EventEmitter { if (!this.queues.has(queue.guild.id)) return; queue.destroy(); this.emit("channelEmpty", queue); - }, queue.options.leaveOnEmptyCooldown || 0); + }, queue.options.leaveOnEmptyCooldown || 0).unref(); queue._cooldownsTimeout.set(`empty_${oldState.guild.id}`, timeout); } } diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index 9aad94f..ef3681c 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -657,7 +657,7 @@ class Queue { this.connection.playStream(resource).then(() => { this.setVolume(this.options.initialVolume); }); - }, this.#getBufferingTimeout()); + }, this.#getBufferingTimeout()).unref(); } /** diff --git a/src/utils/Util.ts b/src/utils/Util.ts index 18f8e80..ff9d0e2 100644 --- a/src/utils/Util.ts +++ b/src/utils/Util.ts @@ -91,7 +91,7 @@ class Util { * @returns {Promise} */ static wait(time: number) { - return new Promise((r) => setTimeout(r, time)); + return new Promise((r) => setTimeout(r, time).unref()); } static noop() {} // eslint-disable-line @typescript-eslint/no-empty-function