()
| 146 | } |
| 147 | |
| 148 | public stop() { |
| 149 | if (this.stopped) return; |
| 150 | |
| 151 | this.stopped = true; |
| 152 | this.loop = false; |
| 153 | this.songs = []; |
| 154 | this.player.stop(); |
| 155 | |
| 156 | !config.PRUNING && this.textChannel.send(i18n.__("play.queueEnded")).catch(console.error); |
| 157 | |
| 158 | if (this.waitTimeout !== null) return; |
| 159 | |
| 160 | this.waitTimeout = setTimeout(() => { |
| 161 | if (this.connection.state.status !== VoiceConnectionStatus.Destroyed) { |
| 162 | try { |
| 163 | this.connection.destroy(); |
| 164 | } catch {} |
| 165 | } |
| 166 | bot.queues.delete(this.interaction.guild!.id); |
| 167 | |
| 168 | !config.PRUNING && this.textChannel.send(i18n.__("play.leaveChannel")); |
| 169 | }, config.STAY_TIME * 1000); |
| 170 | } |
| 171 | |
| 172 | /** |
| 173 | * Processes the song queue for playback. This method checks if the queue is locked or if the player |
no outgoing calls
no test coverage detected