#[non_exhaustive]pub enum TriggerType {
Keyword,
Spam,
KeywordPreset,
MentionSpam,
MemberProfile,
Unknown(u8),
}Expand description
How a rule detects violations.
discord.js counterpart: AutoModerationRuleTriggerType.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Keyword
Content contains words from a list of keywords (up to 6 rules per guild).
Spam
Content is generic spam (1 rule per guild).
KeywordPreset
Content contains words from Discord’s predefined word lists (1 rule per guild).
MentionSpam
Content mentions more unique users and roles than allowed (1 rule per guild).
MemberProfile
A member profile contains words from a list of keywords (1 rule per guild).
Unknown(u8)
A value that this version of the library does not know about.
Discord may add new values at any time. They are preserved here so that no
information is lost and deserialization never fails because of them. Prefer
TriggerType::from over constructing this variant directly.
Implementations§
Source§impl TriggerType
impl TriggerType
Sourcepub const fn value(self) -> u8
pub const fn value(self) -> u8
Returns the raw integer value Discord uses for this variant.
discord.js counterpart: the enum’s numeric value in discord-api-types.
Sourcepub const fn is_unknown(self) -> bool
pub const fn is_unknown(self) -> bool
Returns true if this is a value the library does not know about.
discord.js counterpart: none (discord.js passes unknown numbers through).
Sourcepub const fn from_value(value: u8) -> Self
pub const fn from_value(value: u8) -> Self
Converts a raw value into the matching variant, or Self::Unknown.
discord.js counterpart: none (discord.js passes unknown numbers through).