Class CustomKeywordTriggerConfig
- All Implemented Interfaces:
TriggerConfig
,SerializableData
KEYWORD
trigger.-
Method Summary
Modifier and TypeMethodDescriptionaddKeywords
(String... keywords) Add more keywords match against.addKeywords
(Collection<String> keywords) Add more keywords match against.addPatterns
(String... patterns) Add keywords regex patterns to match against.addPatterns
(Collection<String> patterns) Add keywords regex patterns to match against.setKeywords
(Collection<String> keywords) Changes the keywords to match against to the new list.setPatterns
(Collection<String> patterns) Change the list of keywords regex patterns to match against.toData()
SerializedDataObject
for this object.Methods inherited from class net.dv8tion.jda.api.entities.automod.build.AbstractKeywordTriggerConfig
addAllowList, addAllowList, setAllowList
Methods inherited from class net.dv8tion.jda.api.entities.automod.build.AbstractTriggerConfig
getType
-
Method Details
-
addKeywords
Add more keywords match against.
Keywords are matched case-insensitively, and may also contain whitespace.You can use wildcards at the keyword boundaries to extend the matches:
"foo*"
can match"foo"
,"foobar"
,"foo-bar"
, etc."*foo*"
can match"foo"
,"foobar"
,"barfoo"
, etc."*foo"
can match"foo"
,"barfoo"
,"bar-foo"
, etc.You can also use regex patterns using
TriggerConfig.patternFilter(String...)
.- Parameters:
keywords
- The keywords to match- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-
-
addKeywords
Add more keywords match against.
Keywords are matched case-insensitively, and may also contain whitespace.You can use wildcards at the keyword boundaries to extend the matches:
"foo*"
can match"foo"
,"foobar"
,"foo-bar"
, etc."*foo*"
can match"foo"
,"foobar"
,"barfoo"
, etc."*foo"
can match"foo"
,"barfoo"
,"bar-foo"
, etc.You can also use regex patterns using
TriggerConfig.patternFilter(Collection)
.- Parameters:
keywords
- The keywords to match- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-
-
setKeywords
Changes the keywords to match against to the new list.
Keywords are matched case-insensitively, and may also contain whitespace.You can use wildcards at the keyword boundaries to extend the matches:
"foo*"
can match"foo"
,"foobar"
,"foo-bar"
, etc."*foo*"
can match"foo"
,"foobar"
,"barfoo"
, etc."*foo"
can match"foo"
,"barfoo"
,"bar-foo"
, etc.You can also use regex patterns using
TriggerConfig.patternFilter(Collection)
.- Parameters:
keywords
- The keywords to match- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-
-
addPatterns
Add keywords regex patterns to match against.
Keyword patterns are matched case-insensitively, and may also contain whitespace.Patterns may use anything supported by the rust regex crate. You can use a validator such as Rustexp to validate your pattern.
You can also use simple substring keywords using
TriggerConfig.keywordFilter(String...)
.- Parameters:
patterns
- The keyword patterns to match- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-
-
addPatterns
Add keywords regex patterns to match against.
Keyword patterns are matched case-insensitively, and may also contain whitespace.Patterns may use anything supported by the rust regex crate. You can use a validator such as Rustexp to validate your pattern.
You can also use simple substring keywords using
TriggerConfig.keywordFilter(String...)
.- Parameters:
patterns
- The keyword patterns to match- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-
-
setPatterns
Change the list of keywords regex patterns to match against.
Keyword patterns are matched case-insensitively, and may also contain whitespace.Patterns may use anything supported by the rust regex crate. You can use a validator such as Rustexp to validate your pattern.
You can also use simple substring keywords using
TriggerConfig.keywordFilter(String...)
.- Parameters:
patterns
- The keyword patterns to match- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Overrides:
toData
in classAbstractKeywordTriggerConfig<CustomKeywordTriggerConfig>
- Returns:
DataObject
-