Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Make everithing syncrone to try to fix autovoice channel
Browse files Browse the repository at this point in the history
  • Loading branch information
sclement committed Dec 28, 2023
1 parent 77b32c7 commit db5ff0c
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/main/java/net/Broken/Tools/AutoVoiceChannel.java
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,12 @@ public void join(AudioChannel voiceChannel) {
if (title.isEmpty()) {
title = "Voice @count";
}
title = title.replace("@count", Integer.toString(next));
newChannel.getManager().setName(title).setPosition(voiceChannel.getPosition()).queue();

createdChannels.put(next, newChannel.getId());
title = title.replace("@count", Integer.toString(next));
newChannel.getManager().setName(title).setPosition(voiceChannel.getPosition()).complete();
moveMembers(voiceChannel.getMembers(), newChannel);
createdChannels.put(next, newChannel.getId());

}

}
Expand Down Expand Up @@ -88,7 +89,7 @@ private void moveMembers(List<Member> members, AudioChannel destination) {
restAction = restAction.and(destination.getGuild().moveVoiceMember(member, destination));
}
if (restAction != null) {
restAction.queue();
restAction.complete();
}
}

Expand Down

0 comments on commit db5ff0c

Please sign in to comment.