Skip to content

Commit

Permalink
fix: remove abandoned channels before validating (#348)
Browse files Browse the repository at this point in the history
  • Loading branch information
Tomut0 authored Jan 28, 2023
1 parent 7eb748b commit 5f519c4
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -514,9 +514,12 @@ private void clearChannels() {
List<String> discordClanTags = getCachedChannels().stream().map(GuildChannel::getName).collect(Collectors.toList());

// Removes abandoned channels
List<String> clansToDelete = new ArrayList<>(discordClanTags);
ArrayList<String> clansToDelete = new ArrayList<>(discordClanTags);
clansToDelete.removeAll(clanTags);
clansToDelete.forEach(this::deleteChannel);
clansToDelete.forEach(channelName -> {
deleteChannel(channelName);
discordClanTags.remove(channelName);
});

// Removes invalid channels
for (String clanTag : discordClanTags) {
Expand Down

0 comments on commit 5f519c4

Please # to comment.