Skip to content

Commit 57ec271

Browse files
committed
fix: get boardChannel from Optional
By the time we need to get the contents of boardChannel when we attempt to insert the cool message, the boardChannel's optional will never be empty, so use Optional#get() instead.
1 parent 163d848 commit 57ec271

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

application/src/main/java/org/togetherjava/tjbot/features/basic/CoolMessagesBoardManager.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ public void onMessageReactionAdd(MessageReactionAddEvent event) {
6565
event.retrieveMessage().queue(message -> {
6666
message.addReaction(REACT_EMOJI).queue();
6767

68-
insertCoolMessage(boardChannel.orElseThrow(), message);
68+
insertCoolMessage(boardChannel.get(), message);
6969
}, e -> logger.warn("Tried to retrieve cool message but got: {}", e.getMessage()));
7070
}
7171
}

0 commit comments

Comments
 (0)