SteamWar/BungeeCore
Archiviert
13
2

Fix ChannelManager
Alle Prüfungen waren erfolgreich
SteamWarCI Build successful

Dieser Commit ist enthalten in:
yoyosource 2023-03-23 16:33:52 +01:00
Ursprung 0bab12ed6c
Commit 54bdee79dc

Datei anzeigen

@ -97,20 +97,18 @@ public class ChannelManager extends ListenerAdapter {
return Integer.compare(i1, i2); return Integer.compare(i1, i2);
}); });
if (channels.isEmpty()) { for (int i = channels.size() - 1; i >= 0; i--) {
ChannelAction<VoiceChannel> channelAction = guild.createVoiceChannel(channelNames.get(0)) VoiceChannel channel = channels.get(i);
.setParent(guild.getCategoryById(options.categoryID)); if (channel.getMembers().isEmpty()) {
if (options.channelCreator != null) { channel.delete().queue();
options.channelCreator.accept(channelAction); channels.remove(i);
} }
VoiceChannel newChannel = channelAction.complete();
channels.add(newChannel);
return;
} }
if (channels.size() == 1) { if (channels.size() == options.maxChannels) {
// TODO: Check if channel is not empty and create new channel return;
} }
createChannelWithIndex(channels.size());
} }
@Override @Override