Do everything in one command
This commit is contained in:
parent
5bb2f20221
commit
db70d06dc4
@ -41,20 +41,18 @@ public class AutoVoiceChannel {
|
||||
GuildPreferenceEntity pref = SettingsUtils.getInstance().getPreference(guild);
|
||||
if (pref.isAutoVoice() && voiceChannel.getId().equals(pref.getAutoVoiceChannelID())) {
|
||||
logger.info("Creating new voice channel for Guild : {}", guild.getName());
|
||||
voiceChannel.createCopy().queue(newChannel -> {
|
||||
int next = getNextNumber();
|
||||
String title = pref.getAutoVoiceChannelTitle();
|
||||
if (title.isEmpty()) {
|
||||
title = "Voice @count";
|
||||
}
|
||||
|
||||
title = title.replace("@count", Integer.toString(next));
|
||||
newChannel.getManager().setName(title).queue(t -> {
|
||||
// moveMembers(voiceChannel.getMembers(), (AudioChannel) newChannel);
|
||||
voiceChannel.createCopy().setName(title).setPosition(voiceChannel.getPosition()).queue(newChannel -> {
|
||||
moveMembers(voiceChannel.getMembers(), (AudioChannel) newChannel);
|
||||
createdChannels.put(next, newChannel.getId());
|
||||
});
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public void leave(AudioChannel voiceChannel) {
|
||||
|
Loading…
Reference in New Issue
Block a user