From 9e3b66ee8a75e686269c0c5bbd4997e9948474b3 Mon Sep 17 00:00:00 2001 From: Snowflake107 Date: Sun, 13 Jun 2021 15:07:45 +0545 Subject: [PATCH] Queue#events --- src/Structures/Queue.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/Structures/Queue.ts b/src/Structures/Queue.ts index 1d7fa07..072d9fe 100644 --- a/src/Structures/Queue.ts +++ b/src/Structures/Queue.ts @@ -49,11 +49,14 @@ class Queue { const connection = await this.player.voiceUtils.connect(channel); this.connection = connection; - // it's ok to use this here since Queue listens to the events 1 time per play + // it's ok to use this here since Queue listens to the events 1 time per play and destroys the listener this.connection.setMaxListeners(Infinity); if (channel.type === "stage") await channel.guild.me.voice.setRequestToSpeak(true).catch(() => {}); + this.connection.on("error", err => this.player.emit("error", this, err)); + this.connection.on("debug", msg => this.player.emit("debug", this, msg)); + return this; }