forked from Elijah/AudioBot
check if voice connection is actually open
This commit is contained in:
parent
5d11fbf12d
commit
56d57794c6
1 changed files with 3 additions and 2 deletions
|
@ -70,7 +70,8 @@ client.on('interactionCreate', async i => {
|
|||
audioStream();
|
||||
// connect to voice channel if not already connected
|
||||
var guild = cmd.guild!;
|
||||
if (getVoiceConnection(guild.id)) {
|
||||
var con = getVoiceConnection(guild.id);
|
||||
if (con && con.state.status == VoiceConnectionStatus.Ready) {
|
||||
await cmd.editReply(`Connected to ${vncname}`);
|
||||
return;
|
||||
}
|
||||
|
@ -79,7 +80,7 @@ client.on('interactionCreate', async i => {
|
|||
await cmd.editReply(`Connected to ${vncname}`);
|
||||
return;
|
||||
}
|
||||
var con = joinVoiceChannel({
|
||||
con = joinVoiceChannel({
|
||||
guildId: guild.id,
|
||||
channelId: channel.id,
|
||||
adapterCreator: guild.voiceAdapterCreator,
|
||||
|
|
Loading…
Reference in a new issue