Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add more debug messages for DiscordHook #437

Merged
merged 4 commits into from
Aug 8, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,16 @@ public void onPlayerUnlinking(AccountUnlinkedEvent event) {
protected void setupDiscord() {
Map<String, TextChannel> discordTagChannels = getCachedChannels().stream().
collect(Collectors.toMap(TextChannel::getName, textChannel -> textChannel));
SimpleClans.debug("DiscordTagChannels before clearing: " + String.join(",", discordTagChannels.keySet()));

clearChannels(discordTagChannels);
SimpleClans.debug("DiscordTagChannels after clearing: " + String.join(",", discordTagChannels.keySet()));

resetPermissions(discordTagChannels);

SimpleClans.debug("ClanTags before creating: " + String.join(",", clanTags));
createChannels(discordTagChannels);
SimpleClans.debug("ClanTags after creating: " + String.join(",", clanTags));
}

@NotNull
Expand Down Expand Up @@ -384,6 +390,7 @@ public void createChannel(@NotNull String clanTag)
clanTag, response.code, response.message));
return;
}

for (Map.Entry<ClanPlayer, Member> entry : discordClanPlayers.entrySet()) {
// The map is formed from clan#getMembers (so the clan exists)
//noinspection ConstantConditions
Expand Down Expand Up @@ -592,7 +599,7 @@ private void validateChannel(@NotNull String clanTag)
}

Map<ClanPlayer, Member> discordClanPlayers = getDiscordPlayers(clan);
if (discordClanPlayers.size() == 0) {
if (discordClanPlayers.isEmpty()) {
throw new InvalidChannelException(String.format("Clan %s doesn't have any linked players", clanTag),
"your.clan.doesnt.have.any.linked.player");
}
Expand Down
Loading