Skip to content

Commit 5b9bd08

Browse files
authored
Fix modmail NPE when sent from DMs (#744)
1 parent af59cbb commit 5b9bd08

File tree

1 file changed

+1
-3
lines changed
  • application/src/main/java/org/togetherjava/tjbot/commands/moderation/modmail

1 file changed

+1
-3
lines changed

application/src/main/java/org/togetherjava/tjbot/commands/moderation/modmail/ModMailCommand.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@
4040
*/
4141

4242
public final class ModMailCommand extends SlashCommandAdapter {
43-
4443
private static final Logger logger = LoggerFactory.getLogger(ModMailCommand.class);
4544
public static final String COMMAND_NAME = "modmail";
4645
private static final String OPTION_MESSAGE = "message";
@@ -154,7 +153,7 @@ private MessageCreateAction createModMessage(SlashCommandInteractionEvent event,
154153
String.valueOf(userId)));
155154
}
156155

157-
Optional<Role> moderatorRole = event.getGuild()
156+
Optional<Role> moderatorRole = modMailAuditLog.getGuild()
158157
.getRoles()
159158
.stream()
160159
.filter(role -> configModGroupPattern.test(role.getName()))
@@ -193,5 +192,4 @@ private boolean isChannelOnCooldown(long userId) {
193192
.filter(Instant.now()::isBefore)
194193
.isPresent();
195194
}
196-
197195
}

0 commit comments

Comments
 (0)