@@ -42,6 +42,7 @@ use crate::builder::{
4242 EditAutoModRule ,
4343 EditCommandPermissions ,
4444 EditGuild ,
45+ EditGuildIncidentActions ,
4546 EditGuildWelcomeScreen ,
4647 EditGuildWidget ,
4748 EditMember ,
@@ -263,6 +264,10 @@ pub struct Guild {
263264 /// The stage instances in this guild.
264265 #[ serde( rename = "guild_scheduled_events" ) ]
265266 pub scheduled_events : Vec < ScheduledEvent > ,
267+ /// The id of the channel where this guild will recieve safety alerts.
268+ pub safety_alerts_channel_id : Option < ChannelId > ,
269+ /// The incidents data for this guild, if any.
270+ pub incidents_data : Option < IncidentsData > ,
266271}
267272
268273#[ cfg( feature = "model" ) ]
@@ -2618,6 +2623,28 @@ impl Guild {
26182623 ) -> Result < ( ) > {
26192624 self . id . delete_soundboard ( http, sound_id, audit_log_reason) . await
26202625 }
2626+
2627+ /// Edits the guild incident actions
2628+ ///
2629+ /// **Note**: Requires the [Manage Guild] permission.
2630+ ///
2631+ /// [Manage Guild]: Permissions::MANAGE_GUILD
2632+ ///
2633+ /// # Errors
2634+ ///
2635+ /// Returns [`Error::Http`] if invalid data is given. See [Discord's docs] for more details.
2636+ ///
2637+ /// May also return [`Error::Json`] if there is an error in deserializing the API response.
2638+ ///
2639+ /// [Discord's docs]: https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions
2640+ pub async fn edit_guild_incident_actions (
2641+ self ,
2642+ http : & Http ,
2643+ guild_id : GuildId ,
2644+ builder : EditGuildIncidentActions ,
2645+ ) -> Result < IncidentsData > {
2646+ builder. execute ( http, guild_id) . await
2647+ }
26212648}
26222649
26232650#[ cfg( feature = "model" ) ]
@@ -2939,6 +2966,23 @@ enum_number! {
29392966 }
29402967}
29412968
2969+ /// The [`Guild`]'s incident's data.
2970+ ///
2971+ /// [Discord docs](https://discord.com/developers/docs/resources/guild#incidents-data-object).
2972+ #[ derive( Clone , Copy , Debug , Deserialize , Serialize ) ]
2973+ #[ cfg_attr( feature = "typesize" , derive( typesize:: derive:: TypeSize ) ) ]
2974+ #[ non_exhaustive]
2975+ pub struct IncidentsData {
2976+ /// The time that invites get enabled again.
2977+ pub invites_disabled_until : Option < Timestamp > ,
2978+ /// The time that dms get enabled again.
2979+ pub dms_disabled_until : Option < Timestamp > ,
2980+ /// The time when elevated dm activity was triggered.
2981+ pub dm_spam_detected_at : Option < Timestamp > ,
2982+ /// The time when raid alerts were triggered.
2983+ pub raid_detected_at : Option < Timestamp > ,
2984+ }
2985+
29422986#[ cfg( test) ]
29432987mod test {
29442988 #[ cfg( feature = "model" ) ]
0 commit comments