Skip to content

Commit

Permalink
Fix Discord edits console warnings
Browse files Browse the repository at this point in the history
  • Loading branch information
FireController1847 committed Jun 20, 2024
1 parent 288403d commit 0a4eef9
Showing 1 changed file with 2 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,11 @@ public void onMessageEdit(MessageEditEvent event) {

// If the message is older than 2 minutes, ignore
try {
if (message.getLastEditTimestamp().orElseThrow(() -> new Exception("Last edit timestamp cannot be null for message edit event!")).toEpochMilli() - message.getCreationTimestamp().toEpochMilli() > 120000) {
if (!message.getLastEditTimestamp().isPresent() || message.getLastEditTimestamp().get().toEpochMilli() - message.getCreationTimestamp().toEpochMilli() > 120000) {
return;
}
} catch (Exception e) {
e.printStackTrace();
// ignore
return;
}

Expand Down

0 comments on commit 0a4eef9

Please sign in to comment.