Skip to content

add search-based condition to rule-based automod#555

Open
danthe1st wants to merge 1 commit into
Java-Discord:mainfrom
danthe1st:custom-automod-search
Open

add search-based condition to rule-based automod#555
danthe1st wants to merge 1 commit into
Java-Discord:mainfrom
danthe1st:custom-automod-search

Conversation

@danthe1st

Copy link
Copy Markdown
Member

This PR adds an automod condition to the rule-based automod: The user must have no old enough messages for the automod to trigger. To do this, it first checks the message cache and then uses the new search API (which requires a JDA update) in order to check for older messages.
This message rule is only executed if all previous checks pass (to prevent doing these API requests when it isn't necessary).

As this operation may make a long-running API request, the message filters were changed to run asynchronously.

It also improves the message cache in the following ways:

  • Synchronization clears all rows in the message cache and recreates them in a transaction (the database is only used for restoring the cache on startup).
  • The message cache is being made thread safe.

@danthe1st
danthe1st requested a review from a team as a code owner July 20, 2026 17:58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant