Skip to content

Commit

Permalink
feat(model): add new automod message incident types (#2352)
Browse files Browse the repository at this point in the history
  • Loading branch information
suneettipirneni authored Jun 15, 2024
1 parent b832416 commit 04a2b90
Showing 1 changed file with 26 additions and 1 deletion.
27 changes: 26 additions & 1 deletion twilight-model/src/channel/message/kind.rs
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,14 @@ pub enum MessageType {
StageTopic,
/// System message denoting a guild application premium subscription.
GuildApplicationPremiumSubscription,
/// System message denoting a guild auto moderation incident alerts are enabled.
GuildIncidentAlertModeEnabled,
/// System message denoting a guild auto moderation incident alerts are disabled.
GuildIncidentAlertModeDisabled,
/// System message denoting a guild raid incident report.
GuildIncidentReportRaid,
/// System message denoting a false positive guild raid incident report.
GuildIncidentReportRaidFalseAlarm,
/// Variant value is unknown to the library.
Unknown(u8),
}
Expand Down Expand Up @@ -111,6 +119,11 @@ impl MessageType {
| Self::StageEnd
| Self::StageSpeaker
| Self::StageTopic
| Self::GuildApplicationPremiumSubscription
| Self::GuildIncidentAlertModeEnabled
| Self::GuildIncidentAlertModeDisabled
| Self::GuildIncidentReportRaid
| Self::GuildIncidentReportRaidFalseAlarm
)
}

Expand Down Expand Up @@ -173,6 +186,10 @@ impl From<u8> for MessageType {
29 => Self::StageSpeaker,
31 => Self::StageTopic,
32 => Self::GuildApplicationPremiumSubscription,
36 => Self::GuildIncidentAlertModeEnabled,
37 => Self::GuildIncidentAlertModeDisabled,
38 => Self::GuildIncidentReportRaid,
39 => Self::GuildIncidentReportRaidFalseAlarm,
unknown => Self::Unknown(unknown),
}
}
Expand Down Expand Up @@ -212,6 +229,10 @@ impl From<MessageType> for u8 {
MessageType::StageSpeaker => 29,
MessageType::StageTopic => 31,
MessageType::GuildApplicationPremiumSubscription => 32,
MessageType::GuildIncidentAlertModeEnabled => 36,
MessageType::GuildIncidentAlertModeDisabled => 37,
MessageType::GuildIncidentReportRaid => 38,
MessageType::GuildIncidentReportRaidFalseAlarm => 39,
MessageType::Unknown(unknown) => unknown,
}
}
Expand Down Expand Up @@ -280,7 +301,11 @@ mod tests {
(MessageType::StageEnd, 28, true),
(MessageType::StageSpeaker, 29, true),
(MessageType::StageTopic, 31, true),
(MessageType::GuildApplicationPremiumSubscription, 32, false),
(MessageType::GuildApplicationPremiumSubscription, 32, true),
(MessageType::GuildIncidentAlertModeEnabled, 36, true),
(MessageType::GuildIncidentAlertModeDisabled, 37, true),
(MessageType::GuildIncidentReportRaid, 38, true),
(MessageType::GuildIncidentReportRaidFalseAlarm, 39, true),
];

for (message_type, number, deletable) in MAP {
Expand Down

0 comments on commit 04a2b90

Please sign in to comment.