Skip to content

Commit

Permalink
Fix #312 by ignoring already removed messages
Browse files Browse the repository at this point in the history
  • Loading branch information
rtm516 committed Apr 20, 2024
1 parent e93082d commit 6a55aa2
Showing 1 changed file with 5 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,11 @@ public void onMessageDelete(@NotNull MessageDeleteEvent event) {
if (message.getType() == MessageType.INLINE_REPLY
&& message.getAuthor() == event.getJDA().getSelfUser()
&& message.getMessageReference().getMessageId().equals(event.getMessageId())) {
message.delete().complete();
try {
message.delete().complete();
} catch (Exception ignored) {
// If this fails then the message is already deleted
}
}
}
}
Expand Down

0 comments on commit 6a55aa2

Please sign in to comment.