twilight_validate::request

Function auto_moderation_metadata_preset_allow_list

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

Ensure that an auto moderation rule’s allow_list is correct when using presets.

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

§Errors

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

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