use of Core.Music.GuildMusicManager in project Wylx by Wylx-Bot.
the class VoiceChannelProcessing method checkVoiceChannel.
private void checkVoiceChannel(long guildID) {
GuildMusicManager guildMusicManager = WylxPlayerManager.getInstance().getGuildManager(guildID);
AudioManager manager = Wylx.getInstance().getGuildAudioManager(guildID);
AudioChannel channel = manager.getConnectedChannel();
if (channel == null) {
guildMusicManager.stop();
return;
}
// Leave if we are the only user left
if (manager.isConnected() && channel.getMembers().size() == 1) {
logger.debug("Leaving {} due to inactivity", guildID);
guildMusicManager.stop();
}
}
Aggregations