Skip to content

Commit 7307cdb

Browse files
committed
Adjust docs
1 parent c8a32b1 commit 7307cdb

File tree

5 files changed

+22
-16
lines changed

5 files changed

+22
-16
lines changed

src/builder/edit_guild_incident_actions.rs

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ use crate::model::prelude::*;
66

77
/// A builder for editing guild incident actions.
88
///
9-
/// [Discord's docs]: https://github.com/discord/discord-api-docs/pull/6396
9+
/// [Discord's docs]: https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions
1010
#[derive(Clone, Debug, Default, Serialize)]
1111
#[must_use]
1212
pub struct EditGuildIncidentActions {
@@ -19,30 +19,27 @@ impl EditGuildIncidentActions {
1919
Self::default()
2020
}
2121

22-
/// Sets the time invites to the guild will be disabled until. Must be no further than 1 day in
23-
/// the future.
22+
/// Sets the time until which guild invites will remain disabled, which can be at most 24 hours
23+
/// in the future.
2424
pub fn invites_disabled_until(mut self, timestamp: Timestamp) -> Self {
2525
self.invites_disabled_until = Some(timestamp);
2626
self
2727
}
2828

29-
/// Sets the time dms for users within the guild will be disabled until. Must be no further
30-
/// than 1 day in the future.
29+
/// Sets the time at which direct messages for users within the guild will remain disabled,
30+
/// which can be at most 24 hours in the future.
3131
pub fn dms_disabled_until(mut self, timestamp: Timestamp) -> Self {
3232
self.dms_disabled_until = Some(timestamp);
3333
self
3434
}
3535

3636
/// Modifies the guild's incident actions.
3737
///
38-
///
3938
/// # Errors
4039
///
4140
/// Returns [`Error::Http`] if invalid data is given. See [Discord's docs] for more details.
4241
///
4342
/// May also return [`Error::Json`] if there is an error in deserializing the API response.
44-
///
45-
/// [Discord's docs]: https://github.com/discord/discord-api-docs/pull/6396
4643
#[cfg(feature = "http")]
4744
pub async fn execute(self, http: &Http, guild_id: GuildId) -> Result<IncidentsData> {
4845
http.edit_guild_incident_actions(guild_id, &self).await

src/http/client.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4872,6 +4872,10 @@ impl Http {
48724872
}
48734873

48744874
/// Modify the guild's incident actions.
4875+
///
4876+
/// **Note**: Requires the [Manage Guild] permission.
4877+
///
4878+
/// [Manage Guild]: Permissions::MANAGE_GUILD
48754879
pub async fn edit_guild_incident_actions(
48764880
&self,
48774881
guild_id: GuildId,

src/model/guild/guild_id.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1791,13 +1791,17 @@ impl GuildId {
17911791

17921792
/// Edits the guild incident actions
17931793
///
1794+
/// **Note**: Requires the [Manage Guild] permission.
1795+
///
1796+
/// [Manage Guild]: Permissions::MANAGE_GUILD
1797+
///
17941798
/// # Errors
17951799
///
17961800
/// Returns [`Error::Http`] if invalid data is given. See [Discord's docs] for more details.
17971801
///
17981802
/// May also return [`Error::Json`] if there is an error in deserializing the API response.
17991803
///
1800-
/// [Discord's docs]: https://github.com/discord/discord-api-docs/pull/6396
1804+
/// [Discord's docs]: https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions
18011805
pub async fn edit_guild_incident_actions(
18021806
self,
18031807
http: &Http,

src/model/guild/mod.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -264,7 +264,7 @@ pub struct Guild {
264264
/// The stage instances in this guild.
265265
#[serde(rename = "guild_scheduled_events")]
266266
pub scheduled_events: Vec<ScheduledEvent>,
267-
/// the id of the channel where this guild will recieve safety alerts.
267+
/// The id of the channel where this guild will recieve safety alerts.
268268
pub safety_alerts_channel_id: Option<ChannelId>,
269269
/// The incidents data for this guild, if any.
270270
pub incidents_data: Option<IncidentsData>,
@@ -2626,13 +2626,17 @@ impl Guild {
26262626

26272627
/// Edits the guild incident actions
26282628
///
2629+
/// **Note**: Requires the [Manage Guild] permission.
2630+
///
2631+
/// [Manage Guild]: Permissions::MANAGE_GUILD
2632+
///
26292633
/// # Errors
26302634
///
26312635
/// Returns [`Error::Http`] if invalid data is given. See [Discord's docs] for more details.
26322636
///
26332637
/// May also return [`Error::Json`] if there is an error in deserializing the API response.
26342638
///
2635-
/// [Discord's docs]: https://github.com/discord/discord-api-docs/pull/6396
2639+
/// [Discord's docs]: https://discord.com/developers/docs/resources/guild#modify-guild-incident-actions
26362640
pub async fn edit_guild_incident_actions(
26372641
self,
26382642
http: &Http,
@@ -2964,7 +2968,7 @@ enum_number! {
29642968

29652969
/// The [`Guild`]'s incident's data.
29662970
///
2967-
/// [Discord docs](https://github.com/discord/discord-api-docs/pull/6396).
2971+
/// [Discord docs](https://discord.com/developers/docs/resources/guild#incidents-data-object).
29682972
#[derive(Clone, Copy, Debug, Deserialize, Serialize)]
29692973
#[cfg_attr(feature = "typesize", derive(typesize::derive::TypeSize))]
29702974
#[non_exhaustive]

src/model/guild/partial_guild.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
use serde::Serialize;
22

3-
#[cfg(feature = "unstable_discord_api")]
43
use super::IncidentsData;
54
#[cfg(feature = "model")]
65
use crate::builder::{
@@ -178,10 +177,9 @@ pub struct PartialGuild {
178177
pub stickers: HashMap<StickerId, Sticker>,
179178
/// Whether the guild has the boost progress bar enabled
180179
pub premium_progress_bar_enabled: bool,
181-
/// the id of the channel where this guild will recieve safety alerts.
180+
/// The id of the channel where this guild will recieve safety alerts.
182181
pub safety_alerts_channel_id: Option<ChannelId>,
183182
/// The incidents data for this guild, if any.
184-
#[cfg(feature = "unstable_discord_api")]
185183
pub incidents_data: Option<IncidentsData>,
186184
}
187185

@@ -1716,7 +1714,6 @@ impl From<Guild> for PartialGuild {
17161714
max_stage_video_channel_users: guild.max_stage_video_channel_users,
17171715
premium_progress_bar_enabled: guild.premium_progress_bar_enabled,
17181716
safety_alerts_channel_id: guild.safety_alerts_channel_id,
1719-
#[cfg(feature = "unstable_discord_api")]
17201717
incidents_data: guild.incidents_data,
17211718
}
17221719
}

0 commit comments

Comments
 (0)