Skip to content

Commit cc6a90f

Browse files
committed
Fix voice channel selection
1 parent af44a27 commit cc6a90f

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

src/main/java/net/clementraynaud/skoice/bot/BotVoiceChannel.java

+8-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121

2222
import net.clementraynaud.skoice.Skoice;
2323
import net.clementraynaud.skoice.storage.config.ConfigField;
24-
import net.clementraynaud.skoice.tasks.InterruptSystemTask;
2524
import net.dv8tion.jda.api.Permission;
2625
import net.dv8tion.jda.api.entities.Member;
2726
import net.dv8tion.jda.api.entities.PermissionOverride;
@@ -44,6 +43,14 @@ public void setup(VoiceChannel channel, User user) {
4443
this.plugin.getConfigYamlFile().set(ConfigField.VOICE_CHANNEL_ID.toString(), channel.getId());
4544
if (oldVoiceChannel != null) {
4645
oldVoiceChannel.modifyStatus("").queue();
46+
}
47+
48+
if (this.plugin.getBot().getStatus() == BotStatus.READY) {
49+
this.plugin.getBot().getVoiceChannel().notifyUnlinkedUsers();
50+
this.plugin.getBot().getVoiceChannel().setStatus();
51+
this.plugin.getBot().getVoiceChannel().updatePermissions();
52+
this.plugin.getBot().updateVoiceState();
53+
} else {
4754
this.plugin.getListenerManager().update(user);
4855
}
4956
}

0 commit comments

Comments
 (0)