Fix channel not decrement
This commit is contained in:
parent
1a4899c1cf
commit
7a31b4f645
@ -156,6 +156,7 @@ public class BotListener extends ListenerAdapter {
|
|||||||
super.onGuildVoiceMove(event);
|
super.onGuildVoiceMove(event);
|
||||||
AutoVoiceChannel autoVoiceChannel = AutoVoiceChannel.getInstance(event.getGuild());
|
AutoVoiceChannel autoVoiceChannel = AutoVoiceChannel.getInstance(event.getGuild());
|
||||||
autoVoiceChannel.leave(event.getChannelLeft());
|
autoVoiceChannel.leave(event.getChannelLeft());
|
||||||
|
autoVoiceChannel.join(event.getChannelJoined());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -57,6 +57,7 @@ public class AutoVoiceChannel {
|
|||||||
if (entry.getValue().equals(id)) {
|
if (entry.getValue().equals(id)) {
|
||||||
logger.info("Auto created channel is empty, deleting it ...");
|
logger.info("Auto created channel is empty, deleting it ...");
|
||||||
voiceChannel.delete().reason("Auto-remove empty voice channel").queue();
|
voiceChannel.delete().reason("Auto-remove empty voice channel").queue();
|
||||||
|
createdChannels.remove(entry.getKey());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user