From 7a31b4f645ccbe785e40640780b4767f8bc53f2a Mon Sep 17 00:00:00 2001 From: SebClem Date: Thu, 18 Feb 2021 18:09:42 +0100 Subject: [PATCH] Fix channel not decrement --- src/main/java/net/Broken/BotListener.java | 1 + src/main/java/net/Broken/Tools/AutoVoiceChannel.java | 1 + 2 files changed, 2 insertions(+) diff --git a/src/main/java/net/Broken/BotListener.java b/src/main/java/net/Broken/BotListener.java index 43eb445..c38990f 100644 --- a/src/main/java/net/Broken/BotListener.java +++ b/src/main/java/net/Broken/BotListener.java @@ -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 diff --git a/src/main/java/net/Broken/Tools/AutoVoiceChannel.java b/src/main/java/net/Broken/Tools/AutoVoiceChannel.java index ae40b3c..7baf78b 100644 --- a/src/main/java/net/Broken/Tools/AutoVoiceChannel.java +++ b/src/main/java/net/Broken/Tools/AutoVoiceChannel.java @@ -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()); } } }