diff --git a/src/VoiceInterface/BasicStreamDispatcher.ts b/src/VoiceInterface/BasicStreamDispatcher.ts index 7bf8544..91301be 100644 --- a/src/VoiceInterface/BasicStreamDispatcher.ts +++ b/src/VoiceInterface/BasicStreamDispatcher.ts @@ -29,7 +29,6 @@ class BasicStreamDispatcher extends EventEmitter { public readonly channel: VoiceChannel | StageChannel; public connectPromise?: Promise; public audioResource?: AudioResource; - public paused = false; constructor(connection: VoiceConnection, channel: VoiceChannel | StageChannel) { super(); @@ -118,13 +117,11 @@ class BasicStreamDispatcher extends EventEmitter { pause(interpolateSilence?: boolean) { const success = this.audioPlayer.pause(interpolateSilence); - this.paused = success; return success; } resume() { const success = this.audioPlayer.unpause(); - this.paused = !success; return success; } @@ -159,6 +156,10 @@ class BasicStreamDispatcher extends EventEmitter { if (!this.audioResource) return 0; return this.audioResource.playbackDuration; } + + get paused() { + return [AudioPlayerStatus.AutoPaused, AudioPlayerStatus.Paused].includes(this.audioPlayer.state.status) + } } export { BasicStreamDispatcher as StreamDispatcher };