Skip to content

Commit ac16fdf

Browse files
key2peaceSQKo
andauthored
Pruning permission (#1206)
* 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>
1 parent 89ae6b1 commit ac16fdf

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/Discord/Parts/Guild/Guild.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1225,7 +1225,7 @@ public function getPruneCount(array $options = []): ExtendedPromiseInterface
12251225
$options = $resolver->resolve($options);
12261226

12271227
$botperms = $this->getBotPermissions();
1228-
if ($botperms && ! $botperms->kick_members) {
1228+
if ($botperms && ! ($botperms->kick_members && $botperms->manage_guild)) {
12291229
return reject(new NoPermissionsException("You do not have permission to get prune count in the guild {$this->id}."));
12301230
}
12311231

@@ -1283,7 +1283,7 @@ public function beginPrune(array $options = [], ?string $reason = null): Extende
12831283
$options = $resolver->resolve($options);
12841284

12851285
$botperms = $this->getBotPermissions();
1286-
if ($botperms && ! $botperms->kick_members) {
1286+
if ($botperms && ! ($botperms->kick_members && $botperms->manage_guild)) {
12871287
return reject(new NoPermissionsException("You do not have permission to prune members in the guild {$this->id}."));
12881288
}
12891289

0 commit comments

Comments
 (0)