Skip to content

Commit

Permalink
Don't ban already banned users
Browse files Browse the repository at this point in the history
  • Loading branch information
RikudouSage committed Feb 17, 2024
1 parent 405d526 commit 599f8e3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/Automod/ModAction/BanUser/AbstractBanUserModAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,6 +37,10 @@ public function getDescription(): ?string

public function shouldRun(object $object): bool
{
$author = $this->getAuthor($object);
if ($author->banned) {
return false;
}
foreach ($this->getTextsToCheck($object) as $text) {
if ($text === null) {
continue;
Expand All @@ -50,7 +54,7 @@ public function shouldRun(object $object): bool
}
}

if ($this->findMatchingUsernameRule($this->getAuthor($object)->name)) {
if ($this->findMatchingUsernameRule($author->name)) {
return true;
}

Expand Down

0 comments on commit 599f8e3

Please sign in to comment.