Skip to content

Commit 735f9c8

Browse files
committed
Even more logging
1 parent 79a3720 commit 735f9c8

File tree

1 file changed

+15
-1
lines changed

1 file changed

+15
-1
lines changed

app/src/main/java/net/neoforged/discord/bots/pim/service/IllegalRoleAssignmentService.java

Lines changed: 15 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,12 @@ public void onStartup(JDA bot) {
3232
if (roleConfigurations.isEmpty()) {
3333
LOGGER.warn("No role configurations found to invalidate.");
3434
return;
35+
} else {
36+
LOGGER.info("Processing: {} roles...", roleConfigurations.size());
3537
}
3638

3739
roleConfigurations.forEach(roleConfig -> {
40+
LOGGER.info("Validating role configuration: {}", roleConfig.name);
3841
var guild = bot.getGuildById(roleConfig.guildId);
3942
if (guild == null) {
4043
LOGGER.info("Guild with id: {} does not exist!", roleConfig.guildId);
@@ -45,10 +48,21 @@ public void onStartup(JDA bot) {
4548
if (roles.isEmpty()) {
4649
LOGGER.error("Could not find roles in guild: {} with name: {}", guild.getName(), roleConfig.name);
4750
return;
51+
} else {
52+
LOGGER.info("Checking: {} active roles for invalidation...", roles.size());
4853
}
4954

5055
roles.forEach(role -> {
51-
guild.getMembersWithRoles(role).forEach(member -> {
56+
LOGGER.info("Invalidating role: {}", role.getName());
57+
58+
var membersWithRole = guild.getMembersWithRoles(role);
59+
if (membersWithRole.isEmpty()) {
60+
LOGGER.info("No members found with role: {}", role.getName());
61+
} else {
62+
LOGGER.warn("Checking: {} for validation...", membersWithRole.size());
63+
}
64+
membersWithRole.forEach(member -> {
65+
LOGGER.info("Checking member: {} for role: {} in validation...", member.getEffectiveName(), role.getName());
5266
checkAndHandle(member.getUser(), role, guild);
5367
});
5468
});

0 commit comments

Comments
 (0)