Skip to content

Commit

Permalink
feat(model): add audit log monetization event types (#2243)
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni committed Jul 16, 2023
1 parent ee22c3b commit b606d79
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions twilight-model/src/guild/audit_log/event_type.rs
Original file line number Diff line number Diff line change
Expand Up @@ -226,6 +226,10 @@ pub enum AuditLogEventType {
AutoModerationFlagToChannel,
/// A member has been timed out by AutoMod.
AutoModerationUserCommunicationDisabled,
/// Creator monetization request was created.
CreatorMonetizationRequestCreated,
/// Creator monetization terms were accepted.
CreatorMonetizationTermsAccepted,
/// Variant value is unknown to the library.
Unknown(u16),
}
Expand Down Expand Up @@ -287,6 +291,8 @@ impl From<u16> for AuditLogEventType {
143 => AuditLogEventType::AutoModerationBlockMessage,
144 => AuditLogEventType::AutoModerationFlagToChannel,
145 => AuditLogEventType::AutoModerationUserCommunicationDisabled,
150 => AuditLogEventType::CreatorMonetizationRequestCreated,
151 => AuditLogEventType::CreatorMonetizationTermsAccepted,
unknown => AuditLogEventType::Unknown(unknown),
}
}
Expand Down Expand Up @@ -349,6 +355,8 @@ impl From<AuditLogEventType> for u16 {
AuditLogEventType::AutoModerationBlockMessage => 143,
AuditLogEventType::AutoModerationFlagToChannel => 144,
AuditLogEventType::AutoModerationUserCommunicationDisabled => 145,
AuditLogEventType::CreatorMonetizationRequestCreated => 150,
AuditLogEventType::CreatorMonetizationTermsAccepted => 151,
AuditLogEventType::Unknown(unknown) => unknown,
}
}
Expand Down Expand Up @@ -441,6 +449,14 @@ mod tests {
145,
u16::from(AuditLogEventType::AutoModerationUserCommunicationDisabled)
);
assert_eq!(
150,
u16::from(AuditLogEventType::CreatorMonetizationRequestCreated)
);
assert_eq!(
151,
u16::from(AuditLogEventType::CreatorMonetizationTermsAccepted)
);
assert_eq!(250, u16::from(AuditLogEventType::Unknown(250)));
}
}

0 comments on commit b606d79

Please sign in to comment.