Closed TigDav closed 1 year ago
Function Ban in Discord\Parts\User\Member if daysToDeleteMessages = null, then the user is not banned.
To Reproduce
$member->ban(null, 'reason');
Expected behavior The user will be banned, the message for the last days will not be deleted.
Additional context The problem can be fixed by changing the ban function:
public function ban(?int $daysToDeleteMessages = null, ?string $reason = null): ExtendedPromiseInterface { if (!$guild = $this->guild) { return reject(new \RuntimeException('Member has no Guild Part')); } return is_null($daysToDeleteMessages) ? $guild->bans->ban($this, [], $reason) : $guild->bans->ban($this, ['delete_message_days' => $daysToDeleteMessages], $reason); }
Function Ban in Discord\Parts\User\Member if daysToDeleteMessages = null, then the user is not banned.
To Reproduce
Expected behavior The user will be banned, the message for the last days will not be deleted.
Additional context The problem can be fixed by changing the ban function: