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();
|
audioStream();
|
||||||
// connect to voice channel if not already connected
|
// connect to voice channel if not already connected
|
||||||
var guild = cmd.guild!;
|
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}`);
|
await cmd.editReply(`Connected to ${vncname}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -79,7 +80,7 @@ client.on('interactionCreate', async i => {
|
||||||
await cmd.editReply(`Connected to ${vncname}`);
|
await cmd.editReply(`Connected to ${vncname}`);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
var con = joinVoiceChannel({
|
con = joinVoiceChannel({
|
||||||
guildId: guild.id,
|
guildId: guild.id,
|
||||||
channelId: channel.id,
|
channelId: channel.id,
|
||||||
adapterCreator: guild.voiceAdapterCreator,
|
adapterCreator: guild.voiceAdapterCreator,
|
||||||
|
|
Loading…
Reference in a new issue