fix disconnect issue

This commit is contained in:
Snowflake107 2021-07-04 20:12:56 +05:45
parent 1a5e4cf2b8
commit a9cbc9df01
No known key found for this signature in database
GPG key ID: FA40E3EC5CB6DCD6

View file

@ -195,7 +195,7 @@ class Queue<T = unknown> {
destroy(disconnect = this.options.leaveOnStop) { destroy(disconnect = this.options.leaveOnStop) {
this.#watchDestroyed(); this.#watchDestroyed();
if (this.connection) this.connection.end(); if (this.connection) this.connection.end();
if (disconnect) this.connection.disconnect(); if (disconnect) this.connection?.disconnect();
this.player.queues.delete(this.guild.id); this.player.queues.delete(this.guild.id);
this.player.voiceUtils.cache.delete(this.guild.id); this.player.voiceUtils.cache.delete(this.guild.id);
this.#destroyed = true; this.#destroyed = true;