Skip to content

Commit

Permalink
Permissions Change for Pruning
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
key2peace authored Mar 2, 2024
1 parent afc9dbe commit 225b530
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Discord/Parts/Guild/Guild.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}."));
}

Expand Down Expand Up @@ -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}."));
}

Expand Down

0 comments on commit 225b530

Please sign in to comment.