#
Message Filtering
Online Config Editor
You can edit your config files, using our online config editor at https://editor.firstdark.dev. Alternatively, use the sdconfigeditor
command in your console to edit your config live on the server, using the web interface.
Message filtering is a powerful system, that allows you to replace words or emojis etc, in usernames and messages sent between Minecraft and Discord/Discord and Minecraft.
This is useful for filtering out common spam messages like gg
, creeper
, [REDACTED]
, or, replacing Minecraft Emojis with Discord compatible emojis.
To use this feature, find the filtering
section of the config. By default, it will look like this
#Configure message/username filtering for discord messages
[filtering]
#Enable the filter system
enabled = true
#List of entries to process
entries = []
#Ignore messages sent from certain threads. Enable debug logging to see what thread the message is from
ignoredThreads = []
In the above:
ignoredMessages
-> Enable or Disable the filtering featureentires
-> List of entries to process. See examples below.ignoredThreads
-> This is an advanced feature, used to disable somecatch all
messages relayed from other sources, that do not fall into any of the default categories
#
Examples
In this example, a message starting with Hey everyone
, will be ignored.
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "Hey everyone"
target = "CHAT"
replace = ""
searchMode = "STARTS_WITH"
action = "IGNORE"
appliesTo = "DISCORD"
ignoreConsole = false
So now, every message starting with Hey everyone
or hey everyone
will not be relayed to discord.
#
Explanation of fields
search
-> The text to search fortarget
-> Choose between targetingCHAT
,USERNAME
orBOTH
replace
-> The text, that will replacesearch
, if neededsearchMode
-> How to apply the filter.CONTAINS
,STARTS_WITH
,MATCHES
,REGEX
action
-> The action to perform when the filter matches.IGNORE
orREPLACE
appliesTo
-> Does this filter apply toDISCORD
(messages coming from Minecraft) orMINECRAFT
(messages going to Minecraft)ignoreConsole
-> Should this filter be applied to messages in the Console Relay feature
In this example, we will replace a message starting with gg everyone
, to Good Game everyone
.
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "gg everyone"
target = "CHAT"
replace = "Good Game everyone"
searchMode = "STARTS_WITH"
action = "REPLACE"
appliesTo = "DISCORD"
ignoreConsole = false
In this example, we will not relay a message containing the word dammit
.
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "dammit"
target = "CHAT"
replace = ""
searchMode = "CONTAINS"
action = "IGNORE"
appliesTo = "DISCORD"
ignoreConsole = false
This will ignore any message containing the word dammit
.
In this example, we will replace the word dammit
, with [REDACTED]
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "dammit"
target = "CHAT"
replace = "[REDACTED]"
searchMode = "CONTAINS"
action = "REPLACE"
appliesTo = "DISCORD"
ignoreConsole = false
This will ignore any message containing the word dammit
.
In this example, we will ignore a message like Can someone help me?
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "Can someone help me?"
target = "CHAT"
replace = ""
searchMode = "MATCHES"
action = "IGNORE"
appliesTo = "DISCORD"
ignoreConsole = false
This will ignore any message exactly matching Can someone help me?
.
In this example, we will replace an exact message like I am leaving now
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "I am leaving now"
target = "CHAT"
replace = "Goodbye Everyone"
searchMode = "MATCHES"
action = "REPLACE"
appliesTo = "DISCORD"
ignoreConsole = false
#
Combined Example
#Configure messages that will be ignored when relaying to discord
[filtering]
#Filter certain types of messages from being relayed back to discord
ignoredMessages = true
#List of entries to process
[[filtering.entries]]
search = "Hey everyone"
target = "CHAT"
replace = ""
searchMode = "STARTS_WITH"
action = "IGNORE"
appliesTo = "DISCORD"
ignoreConsole = false
[[filtering.entries]]
search = "gg everyone"
target = "CHAT"
replace = "Good Game everyone"
searchMode = "STARTS_WITH"
action = "REPLACE"
appliesTo = "DISCORD"
ignoreConsole = false
[[filtering.entries]]
search = "dammit"
target = "CHAT"
replace = ""
searchMode = "CONTAINS"
action = "IGNORE"
appliesTo = "DISCORD"
ignoreConsole = false
[[filtering.entries]]
search = "dammit"
target = "CHAT"
replace = "[REDACTED]"
searchMode = "CONTAINS"
action = "REPLACE"
appliesTo = "DISCORD"
ignoreConsole = false
[[filtering.entries]]
search = "Can someone help me?"
target = "CHAT"
replace = ""
searchMode = "MATCHES"
action = "IGNORE"
appliesTo = "DISCORD"
ignoreConsole = false
[[filtering.entries]]
search = "I am leaving now"
target = "CHAT"
replace = "Goodbye Everyone"
searchMode = "MATCHES"
action = "REPLACE"
appliesTo = "DISCORD"
ignoreConsole = false