#[non_exhaustive]pub struct Rule {
pub id: AutoModerationRuleId,
pub guild_id: GuildId,
pub name: CompactString,
pub creator_id: UserId,
pub event_type: EventType,
pub trigger_type: TriggerType,
pub trigger_metadata: TriggerMetadata,
pub actions: Vec<Action>,
pub enabled: bool,
pub exempt_roles: Vec<RoleId>,
pub exempt_channels: Vec<ChannelId>,
}Expand description
discord.js counterpart: AutoModerationRule.
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.id: AutoModerationRuleIdThe rule’s ID.
guild_id: GuildIdThe guild the rule belongs to.
name: CompactStringThe rule’s name.
creator_id: UserIdWho created the rule.
event_type: EventTypeWhat the rule checks: sent messages or member profiles.
trigger_type: TriggerTypeHow the rule detects violations.
trigger_metadata: TriggerMetadataThe settings of the trigger.
actions: Vec<Action>What happens when the rule triggers.
enabled: boolWhether the rule is enabled.
exempt_roles: Vec<RoleId>Roles the rule does not apply to (up to 20).
exempt_channels: Vec<ChannelId>Channels the rule does not apply to (up to 50).
Trait Implementations§
Source§impl<'de> Deserialize<'de> for Rule
impl<'de> Deserialize<'de> for Rule
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 Rule
Source§impl From<AutoModerationRuleCreate> for Rule
impl From<AutoModerationRuleCreate> for Rule
Source§fn from(event: AutoModerationRuleCreate) -> Self
fn from(event: AutoModerationRuleCreate) -> Self
Converts to this type from the input type.
Source§impl From<AutoModerationRuleDelete> for Rule
impl From<AutoModerationRuleDelete> for Rule
Source§fn from(event: AutoModerationRuleDelete) -> Self
fn from(event: AutoModerationRuleDelete) -> Self
Converts to this type from the input type.
Source§impl From<AutoModerationRuleUpdate> for Rule
impl From<AutoModerationRuleUpdate> for Rule
Source§fn from(event: AutoModerationRuleUpdate) -> Self
fn from(event: AutoModerationRuleUpdate) -> Self
Converts to this type from the input type.
impl StructuralPartialEq for Rule
Auto Trait Implementations§
impl Freeze for Rule
impl RefUnwindSafe for Rule
impl Send for Rule
impl Sync for Rule
impl Unpin for Rule
impl UnsafeUnpin for Rule
impl UnwindSafe for Rule
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