#[non_exhaustive]pub struct TriggerMetadata {
pub keyword_filter: Vec<CompactString>,
pub regex_patterns: Vec<CompactString>,
pub presets: Vec<KeywordPresetType>,
pub allow_list: Vec<CompactString>,
pub mention_total_limit: Option<u8>,
pub mention_raid_protection_enabled: bool,
}Expand description
The settings of a rule’s trigger.
Which fields apply depends on the TriggerType: keywords, regexes and the allow list for
Keyword and MemberProfile; presets and the allow list for KeywordPreset; the mention
settings for MentionSpam.
discord.js counterpart: AutoModerationTriggerMetadata.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.keyword_filter: Vec<CompactString>Substrings to search for (up to 1000, 60 characters each). Supports * wildcards.
regex_patterns: Vec<CompactString>Rust-flavored regular expressions to match (up to 10, 260 characters each).
presets: Vec<KeywordPresetType>Discord’s predefined word lists to search for.
allow_list: Vec<CompactString>Substrings that never trigger the rule (up to 100, or 1000 for KeywordPreset).
mention_total_limit: Option<u8>How many unique user and role mentions a message may have (up to 50).
mention_raid_protection_enabled: boolWhether mention raids are detected automatically.
Trait Implementations§
Source§impl Clone for TriggerMetadata
impl Clone for TriggerMetadata
Source§impl Debug for TriggerMetadata
impl Debug for TriggerMetadata
Source§impl Default for TriggerMetadata
impl Default for TriggerMetadata
Source§impl<'de> Deserialize<'de> for TriggerMetadata
impl<'de> Deserialize<'de> for TriggerMetadata
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
impl Eq for TriggerMetadata
Source§impl PartialEq for TriggerMetadata
impl PartialEq for TriggerMetadata
Source§impl Serialize for TriggerMetadata
impl Serialize for TriggerMetadata
impl StructuralPartialEq for TriggerMetadata
Auto Trait Implementations§
impl Freeze for TriggerMetadata
impl RefUnwindSafe for TriggerMetadata
impl Send for TriggerMetadata
impl Sync for TriggerMetadata
impl Unpin for TriggerMetadata
impl UnsafeUnpin for TriggerMetadata
impl UnwindSafe for TriggerMetadata
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more