Skip to content

Commit

Permalink
Fixed crash related to !stop command (#1318)
Browse files Browse the repository at this point in the history
  • Loading branch information
bjr29 authored Nov 11, 2022
1 parent e2ab16b commit cfe6d87
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion structs/MusicQueue.ts
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,11 @@ export class MusicQueue {
!config.PRUNING && this.textChannel.send(i18n.__("play.queueEnded")).catch(console.error);

this.waitTimeout = setTimeout(() => {
this.connection.destroy();
if (this.connection.state.status !== VoiceConnectionStatus.Destroyed) {
try {
this.connection.destroy();
} catch {}
}
bot.queues.delete(this.message.guild!.id);

!config.PRUNING && this.textChannel.send(i18n.__("play.leaveChannel"));
Expand Down

0 comments on commit cfe6d87

Please sign in to comment.