Fix channel not decrement

This commit is contained in:
SebClem 2021-02-18 18:09:42 +01:00
parent 1a4899c1cf
commit 7a31b4f645
2 changed files with 2 additions and 0 deletions

View File

@ -156,6 +156,7 @@ public class BotListener extends ListenerAdapter {
super.onGuildVoiceMove(event);
AutoVoiceChannel autoVoiceChannel = AutoVoiceChannel.getInstance(event.getGuild());
autoVoiceChannel.leave(event.getChannelLeft());
autoVoiceChannel.join(event.getChannelJoined());
}
@Override

View File

@ -57,6 +57,7 @@ public class AutoVoiceChannel {
if (entry.getValue().equals(id)) {
logger.info("Auto created channel is empty, deleting it ...");
voiceChannel.delete().reason("Auto-remove empty voice channel").queue();
createdChannels.remove(entry.getKey());
}
}
}