get the basic bot working

This commit is contained in:
Snowflake107 2021-06-12 01:04:48 +05:45
parent 61c30986ea
commit 502fe11392

View file

@ -130,7 +130,8 @@ class BasicStreamDispatcher extends EventEmitter<VoiceEvents> {
async playStream(resource: AudioResource<Track> = this.audioResource) {
if (!resource) throw new PlayerError("Audio resource is not available!");
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, 20000);
this.audioPlayer.play(resource);
return this;