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);
});
if (channels.isEmpty()) {
ChannelAction<VoiceChannel> channelAction = guild.createVoiceChannel(channelNames.get(0))
.setParent(guild.getCategoryById(options.categoryID));
if (options.channelCreator != null) {
options.channelCreator.accept(channelAction);
for (int i = channels.size() - 1; i >= 0; i--) {
VoiceChannel channel = channels.get(i);
if (channel.getMembers().isEmpty()) {
channel.delete().queue();
channels.remove(i);
}
VoiceChannel newChannel = channelAction.complete();
channels.add(newChannel);
return;
}
if (channels.size() == 1) {
// TODO: Check if channel is not empty and create new channel
if (channels.size() == options.maxChannels) {
return;
}
createChannelWithIndex(channels.size());
}
@Override