use of net.dv8tion.jda.api.entities.VoiceChannel in project c0debaseBot by Biospheere.
the class GuildReadyListener method initTempchannel.
private void initTempchannel(final Guild guild) {
for (VoiceChannel voiceChannel : guild.getVoiceChannels()) {
final String name = ("temp-" + voiceChannel.getName().toLowerCase()).replaceAll("\\s+", "-");
final TextChannel textChannel = voiceChannel.getGuild().getTextChannelsByName(name, true).isEmpty() ? null : voiceChannel.getGuild().getTextChannelsByName(name, true).get(0);
if (textChannel == null) {
bot.getTempchannels().put(voiceChannel.getId(), new Tempchannel());
} else {
Tempchannel tempchannel = new Tempchannel(textChannel);
tempchannel.onLoad(textChannel, voiceChannel);
bot.getTempchannels().put(voiceChannel.getId(), tempchannel);
}
}
}
Aggregations