🐛 Run entersState inside play() only
This commit is contained in:
parent
fca648189a
commit
2566e30cac
2 changed files with 1 additions and 15 deletions
|
@ -206,10 +206,6 @@ class Queue<T = unknown> {
|
|||
}
|
||||
});
|
||||
|
||||
await this.player.voiceUtils.enterReady(this.connection.voiceConnection, {
|
||||
maxTime: this.player.options.connectionTimeout || 30_000
|
||||
});
|
||||
|
||||
return this;
|
||||
}
|
||||
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
import { VoiceChannel, StageChannel, Collection, Snowflake } from "discord.js";
|
||||
import { DiscordGatewayAdapterCreator, entersState, joinVoiceChannel, VoiceConnection, VoiceConnectionStatus } from "@discordjs/voice";
|
||||
import { DiscordGatewayAdapterCreator, joinVoiceChannel, VoiceConnection } from "@discordjs/voice";
|
||||
import { StreamDispatcher } from "./StreamDispatcher";
|
||||
|
||||
class VoiceUtils {
|
||||
|
@ -59,16 +59,6 @@ class VoiceUtils {
|
|||
return conn;
|
||||
}
|
||||
|
||||
public async enterReady(conn: VoiceConnection, options: { maxTime?: number } = {}) {
|
||||
try {
|
||||
conn = await entersState(conn, VoiceConnectionStatus.Ready, options?.maxTime ?? 20000);
|
||||
return conn;
|
||||
} catch (err) {
|
||||
conn.destroy();
|
||||
throw err;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Disconnects voice connection
|
||||
* @param {VoiceConnection} connection The voice connection
|
||||
|
|
Loading…
Reference in a new issue