Skip to content

Commit ea0e0ae

Browse files
authored
Update permissions for start_prune (#2881)
discord/discord-api-docs#6688
1 parent f53a56b commit ea0e0ae

File tree

3 files changed

+7
-4
lines changed

3 files changed

+7
-4
lines changed

src/model/guild/guild_id.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1430,13 +1430,14 @@ impl GuildId {
14301430
///
14311431
/// See the documentation on [`GuildPrune`] for more information.
14321432
///
1433-
/// **Note**: Requires the [Kick Members] permission.
1433+
/// **Note**: Requires [Kick Members] and [Manage Guild] permissions.
14341434
///
14351435
/// # Errors
14361436
///
14371437
/// Returns [`Error::Http`] if the current user lacks permission.
14381438
///
14391439
/// [Kick Members]: Permissions::KICK_MEMBERS
1440+
/// [Manage Guild]: Permissions::KICK_MEMBERS
14401441
#[inline]
14411442
pub async fn start_prune(self, http: impl AsRef<Http>, days: u8) -> Result<GuildPrune> {
14421443
http.as_ref().start_guild_prune(self, days, None).await

src/model/guild/mod.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2354,7 +2354,7 @@ impl Guild {
23542354
///
23552355
/// See the documentation on [`GuildPrune`] for more information.
23562356
///
2357-
/// **Note**: Requires the [Kick Members] permission.
2357+
/// **Note**: Requires [Kick Members] and [Manage Guild] permissions.
23582358
///
23592359
/// # Errors
23602360
///
@@ -2366,13 +2366,14 @@ impl Guild {
23662366
/// Can also return an [`Error::Json`] if there is an error deserializing the API response.
23672367
///
23682368
/// [Kick Members]: Permissions::KICK_MEMBERS
2369+
/// [Manage Guild]: Permissions::MANAGE_GUILD
23692370
/// [`Error::Http`]: crate::error::Error::Http
23702371
/// [`Error::Json`]: crate::error::Error::Json
23712372
pub async fn start_prune(&self, cache_http: impl CacheHttp, days: u8) -> Result<GuildPrune> {
23722373
#[cfg(feature = "cache")]
23732374
{
23742375
if let Some(cache) = cache_http.cache() {
2375-
self.require_perms(cache, Permissions::KICK_MEMBERS)?;
2376+
self.require_perms(cache, Permissions::KICK_MEMBERS | Permissions::MANAGE_GUILD)?;
23762377
}
23772378
}
23782379

src/model/guild/partial_guild.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1119,7 +1119,7 @@ impl PartialGuild {
11191119
///
11201120
/// See the documentation on [`GuildPrune`] for more information.
11211121
///
1122-
/// **Note**: Requires the [Kick Members] permission.
1122+
/// **Note**: Requires [Kick Members] and [Manage Guild] permissions.
11231123
///
11241124
/// # Errors
11251125
///
@@ -1131,6 +1131,7 @@ impl PartialGuild {
11311131
/// Can also return an [`Error::Json`] if there is an error deserializing the API response.
11321132
///
11331133
/// [Kick Members]: Permissions::KICK_MEMBERS
1134+
/// [Manage Guild]: Permissions::MANAGE_GUILD
11341135
/// [`Error::Http`]: crate::error::Error::Http
11351136
/// [`Error::Json`]: crate::error::Error::Json
11361137
pub async fn start_prune(&self, cache_http: impl CacheHttp, days: u8) -> Result<GuildPrune> {

0 commit comments

Comments
 (0)