feat(Player): add connectionTimeout option

This commit is contained in:
DevAndromeda 2021-08-07 21:21:58 +05:45
parent db806fcce3
commit bce34c9fc8
No known key found for this signature in database
GPG key ID: FA40E3EC5CB6DCD6

View file

@ -185,7 +185,7 @@ class StreamDispatcher extends EventEmitter<VoiceEvents> {
async playStream(resource: AudioResource<Track> = this.audioResource) {
if (!resource) throw new PlayerError("Audio resource is not available!", ErrorStatusCode.NO_AUDIO_RESOURCE);
if (!this.audioResource) this.audioResource = resource;
if (this.voiceConnection.state.status !== VoiceConnectionStatus.Ready) await entersState(this.voiceConnection, VoiceConnectionStatus.Ready, 20000);
if (this.voiceConnection.state.status !== VoiceConnectionStatus.Ready) await entersState(this.voiceConnection, VoiceConnectionStatus.Ready, this.connectionTimeout);
this.audioPlayer.play(resource);
return this;