twilight_validate::request

Function auto_moderation_metadata_regex_patterns

source
pub fn auto_moderation_metadata_regex_patterns(
    patterns: &[impl AsRef<str>],
) -> Result<(), ValidationError>
Expand description

Ensure that an auto moderation rule’s regex_patterns is correct.

The length must be at most AUTO_MODERATION_METADATA_REGEX_PATTERNS_MAX. This is based on this documentation entry.

§Errors

Returns an error of type AutoModerationMetadataRegexPatterns if the length is invalid.

Returns an error of type AutoModerationMetadataRegexPatternsItem if any of the items are invalid.