Skip to content

Commit

Permalink
Forcibly process messages, despite processing being disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
sciwhiz12 committed Feb 28, 2024
1 parent b554d6b commit 637e68d
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 2 deletions.
2 changes: 1 addition & 1 deletion src/main/java/tk/sciwhiz12/concord/ChatBot.java
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ void shutdown() {
Concord.LOGGER.info(BOT, "Shutting down Discord bot...");
messaging.allowProcessingMessages(false);
// Process all pending messages now
messaging.processMessages();
messaging.processMessages(true);
NeoForge.EVENT_BUS.unregister(msgListener);
NeoForge.EVENT_BUS.unregister(playerListener);
NeoForge.EVENT_BUS.unregister(statusListener);
Expand Down
7 changes: 6 additions & 1 deletion src/main/java/tk/sciwhiz12/concord/msg/Messaging.java
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,12 @@ public void allowProcessingMessages(boolean processMessages) {
}

public void processMessages() {
if (!processMessages) return;
this.processMessages(false);
}

@ApiStatus.Internal
public void processMessages(boolean bypass) {
if (!processMessages && !bypass) return;

// TODO: rate-limiting
MessageEntry entry;
Expand Down

0 comments on commit 637e68d

Please sign in to comment.