Filters
The chat/filters.yml file defines rules for monitoring and controlling player chat messages.
Filter Types
SolarityChat supports several types of filters to protect your server's chat:
BLOCKED_WORDS: Matches specific words and phrases.smart-filter: Set totrueto detect variations and bypass attempts (e.g., using numbers like3instead ofe).fuzzy-matching: Set totrueto match words that are similar to the blocked word.fuzzy-threshold: A value between0.0and1.0(default0.85).
REGEX: Use advanced regular expressions to match complex patterns like URLs or IP addresses.CAPS: Prevents players from using too many capital letters in a single message.threshold: The percentage of capital letters that will trigger the filter (e.g.,0.7for 70%).min-length: The minimum message length required for the filter to activate.
SPAM_CHARACTERS: Detects and limits the same character being repeated many times (e.g.,Heeeeeeelp).max-consecutive: The maximum number of times a single character can be repeated.
Filter Actions
When a filter is triggered, you can define one or more actions to perform:
CANCEL_EVENT: Prevents the message from appearing in chat.MESSAGE:&cYour Message: Sends a custom message to the player who triggered the filter.NOTIFY_STAFF: Sends an alert to all online staff members with thesolaritychat.toggle-alertspermission.DISCORD_WEBHOOK: Sends a detailed alert to your Discord server via the configured webhook.RUN_COMMANDS:[command1, command2]: Executes one or more server commands. Use the%player%placeholder for the player's name.
Example Filter:
swearing:
enabled: true
type: "BLOCKED_WORDS"
smart-filter: true
words:
- "badword1"
- "badword2"
actions:
- "CANCEL_EVENT"
- "MESSAGE:&cPlease keep the chat clean!"
- "NOTIFY_STAFF"
- "RUN_COMMANDS:[warn %player% Swearing]"