Class AbstractKeywordTriggerConfig<B extends AbstractKeywordTriggerConfig<B>>
java.lang.Object
net.dv8tion.jda.api.entities.automod.build.AbstractTriggerConfig<B>
net.dv8tion.jda.api.entities.automod.build.AbstractKeywordTriggerConfig<B>
- Type Parameters:
B
- The builder type
- All Implemented Interfaces:
TriggerConfig
,SerializableData
- Direct Known Subclasses:
CustomKeywordTriggerConfig
,PresetKeywordTriggerConfig
public abstract class AbstractKeywordTriggerConfig<B extends AbstractKeywordTriggerConfig<B>>
extends AbstractTriggerConfig<B>
Abstract for all keyword trigger types.
-
Method Summary
Modifier and TypeMethodDescriptionaddAllowList
(String... keywords) Add keywords to the allow list.addAllowList
(Collection<String> keywords) Add keywords to the allow list.setAllowList
(Collection<String> keywords) Change the allow list to the provided keywords.toData()
SerializedDataObject
for this object.Methods inherited from class net.dv8tion.jda.api.entities.automod.build.AbstractTriggerConfig
getType
-
Method Details
-
addAllowList
Add keywords to the allow list.Keywords added to the allow list will not be considered as a match and won't trigger the rule execution.
Keywords follow the same rules as
CustomKeywordTriggerConfig.addKeywords(String...)
.- Parameters:
keywords
- The keywords to allow- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-- If any of the keywords is empty, blank, or null
- If more than the allowed number of keywords are added to the list (100 for custom keyword lists, 1000 for preset keyword lists)
- If any keyword is longer than
AutoModRule.MAX_KEYWORD_LENGTH
-
addAllowList
Add keywords to the allow list.Keywords added to the allow list will not be considered as a match and won't trigger the rule execution.
Keywords follow the same rules as
CustomKeywordTriggerConfig.addKeywords(String...)
.- Parameters:
keywords
- The keywords to allow- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-- If any of the keywords is empty, blank, or null
- If more than the allowed number of keywords are added to the list (100 for custom keyword lists, 1000 for preset keyword lists)
- If any keyword is longer than
AutoModRule.MAX_KEYWORD_LENGTH
-
setAllowList
Change the allow list to the provided keywords.Keywords added to the allow list will not be considered as a match and won't trigger the rule execution.
Keywords follow the same rules as
CustomKeywordTriggerConfig.addKeywords(String...)
.- Parameters:
keywords
- The keywords to allow- Returns:
- The current config for chaining convenience
- Throws:
IllegalArgumentException
-- If any of the keywords is empty, blank, or null
- If more than the allowed number of keywords are added to the list (100 for custom keyword lists, 1000 for preset keyword lists)
- If any keyword is longer than
AutoModRule.MAX_KEYWORD_LENGTH
-
toData
Description copied from interface:SerializableData
SerializedDataObject
for this object.- Specified by:
toData
in interfaceSerializableData
- Overrides:
toData
in classAbstractTriggerConfig<B extends AbstractKeywordTriggerConfig<B>>
- Returns:
DataObject
-