Queue#events

This commit is contained in:
Snowflake107 2021-06-13 15:07:45 +05:45
parent b87485edb5
commit 9e3b66ee8a

View file

@ -49,11 +49,14 @@ class Queue<T = unknown> {
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;
}