From f2f6b11bfef3596091ca6f0f3a1ae8618fa0ca5f Mon Sep 17 00:00:00 2001 From: Alexander Maassen Date: Sun, 3 Mar 2024 11:40:20 +0100 Subject: [PATCH] Permissions Change for Pruning (#1204) * Permissions Change for Pruning Starting on March 15, 2024, the Get Guild Prune Count and Begin Guild Prune endpoints will require the MANAGE_GUILD permission alongside the existing KICK_MEMBERS permission. * Update src/Discord/Parts/Guild/Guild.php Co-authored-by: SQKo <87897282+SQKo@users.noreply.github.com> * Update src/Discord/Parts/Guild/Guild.php Co-authored-by: SQKo <87897282+SQKo@users.noreply.github.com> --------- Co-authored-by: SQKo <87897282+SQKo@users.noreply.github.com> --- src/Discord/Parts/Guild/Guild.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Discord/Parts/Guild/Guild.php b/src/Discord/Parts/Guild/Guild.php index c733c03b6..d492ecde2 100644 --- a/src/Discord/Parts/Guild/Guild.php +++ b/src/Discord/Parts/Guild/Guild.php @@ -1225,7 +1225,7 @@ public function getPruneCount(array $options = []): ExtendedPromiseInterface $options = $resolver->resolve($options); $botperms = $this->getBotPermissions(); - if ($botperms && ! $botperms->kick_members) { + if ($botperms && ! ($botperms->kick_members && $botperms->manage_guild)) { return reject(new NoPermissionsException("You do not have permission to get prune count in the guild {$this->id}.")); } @@ -1283,7 +1283,7 @@ public function beginPrune(array $options = [], ?string $reason = null): Extende $options = $resolver->resolve($options); $botperms = $this->getBotPermissions(); - if ($botperms && ! $botperms->kick_members) { + if ($botperms && ! ($botperms->kick_members && $botperms->manage_guild)) { return reject(new NoPermissionsException("You do not have permission to prune members in the guild {$this->id}.")); }